78 lines
2.5 KiB
PHP
78 lines
2.5 KiB
PHP
<?php
|
|
|
|
namespace Tests\Feature\ApiV2;
|
|
|
|
use App\Enums\ApiStatus;
|
|
use App\Enums\ArcadiaOrderType;
|
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
|
use Illuminate\Support\Str;
|
|
use Tests\CreatesApplication;
|
|
|
|
class ArcadiaTest extends ApiBase
|
|
{
|
|
use CreatesApplication;
|
|
use DatabaseTransactions;
|
|
|
|
/**
|
|
* route: apiV2.customers.arcadia.outgoingMail
|
|
*/
|
|
public function testArcadiaSendOrderDefault()
|
|
{
|
|
extract($this->getCustomer());
|
|
$data = [
|
|
'deliver' => [
|
|
'email' => $customer->email,
|
|
'firstname' => $info->firstname,
|
|
'lastname' => $info->lastname,
|
|
'phone' => $info->phone,
|
|
'address' => $info->address,
|
|
'address2' => $info->address2,
|
|
'city' => $info->city,
|
|
'postcode' => $info->postcode,
|
|
],
|
|
'operation' => 16,
|
|
'label_type_support' => 'Send Departaimants',
|
|
'order_date' => \date('Y/m/d H:i:s'),
|
|
'state_order' => ArcadiaOrderType::cb()->value,
|
|
'support_code' => 1,
|
|
'label_type_support' => 'Fond carte Aimanté',
|
|
'order_num' => 23,
|
|
'package_unit_weight' => 0,
|
|
];
|
|
$response = $this->callApiWithToken($service, 'post', route(
|
|
'apiV2.arcadia.outgoingMailDefault'
|
|
), $data);
|
|
$json = $response->decodeResponseJson();
|
|
|
|
$this->assertApiResponseStatusIs($json, ApiStatus::OK());
|
|
}
|
|
|
|
public function testArcadiaSendOrderGame()
|
|
{
|
|
extract($this->getCustomer());
|
|
$data = [
|
|
'deliver' => [
|
|
'email' => $customer->email,
|
|
'firstname' => $info->firstname,
|
|
'lastname' => $info->lastname,
|
|
'phone' => $info->phone,
|
|
'address' => $info->address,
|
|
'address2' => $info->address2,
|
|
'city' => $info->city,
|
|
'postcode' => $info->postcode,
|
|
],
|
|
'operation' => 16,
|
|
'order_date' => date('Y/m/d H:i:s'),
|
|
'support_code' => 32,
|
|
'label_type_support' => 'Jeux Reghalal',
|
|
'code_unique' => \strtoupper(\str_replace('-', '', (string)Str::uuid())),
|
|
'code_on_pack' => '2563547'
|
|
];
|
|
$response = $this->callApiWithToken($service, 'post', route(
|
|
'apiV2.arcadia.outgoingMailGame',
|
|
), $data);
|
|
$json = $response->decodeResponseJson();
|
|
|
|
$this->assertApiResponseStatusIs($json, ApiStatus::OK());
|
|
}
|
|
}
|