ldc-crm/tests/Unit/CrmClientV2ArcadiaTest.php
Jérémy Munsch 923e566ee7
Changed Arcadia mails, add customer parameters for these calls
Updated Client
bump to 2.2.0
2021-10-18 09:03:00 +02:00

62 lines
2.3 KiB
PHP

<?php
namespace Tests\Unit;
use Illuminate\Support\Str;
use LDC\LDCCRM\CrmApiV2;
use LDC\LDCCRM\Enums\ArcadiaOrderType;
use LDC\LDCCRM\Models\ArcadiaMailDefault;
use LDC\LDCCRM\Models\ArcadiaMailGame;
class CrmClientV2ArcadiaTest extends CrmClientTester
{
public function testArcadiaSendOrderDefault()
{
$api = new CrmApiV2();
$customer = $api->getCustomerOrNew(static::$info->hashcode);
dump(static::$info->postcode);
$arcadiaOrderMail = new ArcadiaMailDefault([
'email' => static::$customer->email,
'firstname' => static::$info->firstname,
'lastname' => static::$info->lastname,
'phone' => static::$info->phone,
'address' => static::$info->address,
'address2' => static::$info->address2,
'city' => static::$info->city,
'postcode' => static::$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' => 32,
'label_type_support' => 'Fond carte Aimanté',
'order_num' => 23,
'package_unit_weight' => 200,
]);
$this->assertTrue($arcadiaOrderMail->send($customer));
}
public function testArcadiaSendOrderGame()
{
$api = new CrmApiV2();
$customer = $api->getCustomerOrNew(static::$info->hashcode);
dump(static::$info->postcode);
$arcadiaOrderMail = new ArcadiaMailGame([
'email' => static::$customer->email,
'firstname' => static::$info->firstname,
'lastname' => static::$info->lastname,
'phone' => static::$info->phone,
'address' => static::$info->address,
'address2' => static::$info->address2,
'city' => static::$info->city,
'postcode' => static::$info->postcode,
'operation' => 16,
'order_date' => date('Y/m/d H:i:s'),
'support_code' => 32,
'label_type_support' => 'Jeux Reghalal',
'code_unique' => (string)Str::uuid(),
'code_on_pack' => 'anystring'
]);
$this->assertTrue($arcadiaOrderMail->send($customer));
}
}