1
0
mirror of synced 2024-11-22 05:16:07 +03:00

addTags and removeTags fields

This commit is contained in:
Alex Lushpai 2022-04-27 10:07:42 +03:00 committed by GitHub
commit 48ed7e168a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 45 additions and 0 deletions

View File

@ -120,6 +120,22 @@ class Customer implements CustomerInterface
*/ */
public $tags; 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 * @var float
* *

View File

@ -2698,4 +2698,33 @@ EOF;
self::assertModelEqualsToResponse($json, $response); 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);
}
} }