1
0
mirror of synced 2024-11-24 14:26:06 +03:00

addTags and removeTags fields

This commit is contained in:
Pavel 2022-04-25 11:30:43 +03:00
parent a5ed9af862
commit c1719bf84a
2 changed files with 45 additions and 0 deletions

View File

@ -120,6 +120,22 @@ class Customer implements CustomerInterface
*/
public $tags;
/**
* @var string[]
*
* @JMS\Type("array<string>")
* @JMS\SerializedName("addTags")
*/
public $addTags;
/**
* @var string[]
*
* @JMS\Type("array<string>")
* @JMS\SerializedName("removeTags")
*/
public $removeTags;
/**
* @var float
*

View File

@ -2698,4 +2698,33 @@ EOF;
self::assertModelEqualsToResponse($json, $response);
}
public function testCustomersEditTags(): void
{
$json = <<<'EOF'
{
"success": true,
"id": 4770
}
EOF;
$request = new CustomersEditRequest();
$request->customer = new Customer();
$request->by = ByIdentifier::ID;
$request->site = 'aliexpress';
$request->customer->firstName = 'Test';
$request->customer->addTags = ['tag1', 'tag2'];
$request->customer->removeTags = ['tag3', 'tag4'];
$mock = static::createApiMockBuilder('customers/4770/edit');
$mock->matchMethod(RequestMethod::POST)
->matchBody(static::encodeForm($request))
->reply(200)
->withBody($json);
$client = TestClientFactory::createClient($mock->getClient());
$response = $client->customers->edit(4770, $request);
self::assertModelEqualsToResponse($json, $response);
}
}