FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
admin-api-php-sdk/tests/ProductVariantStockTest.php at master · aboutyou/admin-api-php-sdk · GitHub
This repository was archived by the owner on Oct 11, 2023. It is now read-only.
aboutyou
/
admin-api-php-sdk
Public archive
Notifications
You must be signed in to change notification settings
Fork
2
Star
3
Code
Issues
1
Pull requests
1
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
admin-api-php-sdk
/
tests
/
ProductVariantStockTest.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
38 lines (29 loc) · 1.58 KB
Breadcrumbs
admin-api-php-sdk
/
tests
/
ProductVariantStockTest.php
Copy path
File metadata and controls
38 lines (29 loc) · 1.58 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
namespace
AboutYou
\
Cloud
\
AdminApi
;
use
AboutYou
\
Cloud
\
AdminApi
\
Models
\
Identifier
;
/**
* @internal
*/
final
class
ProductVariantStockTest
extends
BaseApiTestCase
{
public
function
testCreate
()
{
$
expectedRequestJson
=
$
this
->
loadFixture
(
'
ProductVariantStockCreateRequest.json
'
);
$
requestEntity
=
new
\
AboutYou
\
Cloud
\
AdminApi
\
Models
\
ProductVariantStock
(
$
expectedRequestJson
);
static
::
assertJsonStringEqualsJsonString
(
json_encode
(
$
expectedRequestJson
),
$
requestEntity
->
toJson
());
$
responseEntity
=
$
this
->
api
->
productVariantStocks
->
create
(Identifier::
fromId
(
1
),
$
requestEntity
, []);
$
expectedResponseJson
=
$
this
->
loadFixture
(
'
ProductVariantStockCreateResponse.json
'
);
static
::
assertInstanceOf
(\
AboutYou
\
Cloud
\
AdminApi
\
Models
\ProductVariantStock::class,
$
responseEntity
);
static
::
assertJsonStringEqualsJsonString
(
json_encode
(
$
expectedResponseJson
),
$
responseEntity
->
toJson
());
}
public
function
testAll
()
{
$
responseEntity
=
$
this
->
api
->
productVariantStocks
->
all
(Identifier::
fromId
(
1
), []);
$
expectedResponseJson
=
$
this
->
loadFixture
(
'
ProductVariantStockAllResponse.json
'
);
static
::
assertInstanceOf
(\
AboutYou
\
Cloud
\
AdminApi
\
Models
\ProductVariantStockCollection::class,
$
responseEntity
);
static
::
assertJsonStringEqualsJsonString
(
json_encode
(
$
expectedResponseJson
),
$
responseEntity
->
toJson
());
foreach
(
$
responseEntity
->
getEntities
()
as
$
collectionEntity
) {
static
::
assertInstanceOf
(\
AboutYou
\
Cloud
\
AdminApi
\
Models
\ProductVariantStock::class,
$
collectionEntity
);
}
}
}
Back
|
FazBrowse Home
|
New Git URL