Skip to content

Commit

Permalink
Fix some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
youbs committed Oct 31, 2018
1 parent 6b6ecc7 commit a5d7317
Show file tree
Hide file tree
Showing 15 changed files with 396 additions and 427 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ test-phpunit-ci: var/cache var/logs var/translations build
chmod -R 777 ./var/logs
php -dxdebug.coverage_enable=1 ./vendor/bin/phpunit --configuration ./phpunit.xml --log-junit build/junit.xml --coverage-clover ./clover.xml

delete-all-cassettes:
cd tests/ && find . -name "*.yml" -type f -delete

var/cache:
mkdir -p var/cache

Expand Down
18 changes: 9 additions & 9 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/Service/BasketService.php
Original file line number Diff line number Diff line change
Expand Up @@ -289,12 +289,12 @@ public function setPickupPoint(SetPickupPointCommand $command): void
/**
* @throws \Wizaplace\SDK\Exception\SomeParametersAreInvalid
*/
public function setMRPickupPoint(SetPickupPointCommand $command): array
public function setMondialRelayPickupPoint(SetPickupPointCommand $command): array
{
$command->setBasketId($this->getBasketId());

try {
return $this->baseService->setMRPickupPoint($command);
return $this->baseService->setMondialRelayPickupPoint($command);
} finally {
$this->basket = null; // invalidate local cache
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,13 @@
code: '200'
message: OK
headers:
Date: 'Mon, 30 Oct 2017 09:36:39 GMT'
Server: 'Apache/2.4.10 (Debian)'
Date: 'Fri, 26 Oct 2018 12:39:40 GMT'
Server: 'Apache/2.4.25 (Debian)'
X-Protected-By: Sqreen
Cache-Control: 'no-cache, private'
Content-Language: fr
X-Debug-Token: ee7371
X-Debug-Token-Link: 'http://wizaplace.loc/_profiler/ee7371'
Content-Length: '3841'
X-Debug-Token: 470af5
X-Debug-Token-Link: 'http://wizaplace.loc/_profiler/470af5'
Content-Length: '1772'
Content-Type: application/json
body: '{"id":5,"code":"32094574920","supplierReference":"TEST-ATTRIBUTES","name":"Product with complex attributes","url":"http:\/\/wizaplace.loc\/special-category-dedicated-to-specific-tests\/product-with-complex-attributes.html","shortDescription":"","description":"","slug":"product-with-complex-attributes","minPrice":15,"greenTax":0,"isTransactional":true,"weight":1.23,"averageRating":null,"shippings":[{"name":"TNT Express","image":null,"firstRate":0,"nextRate":0},{"name":"Lettre prioritaire","image":null,"firstRate":0,"nextRate":0},{"name":"Colissmo","image":null,"firstRate":0,"nextRate":0}],"companies":[{"id":3,"name":"The World Company Inc.","slug":"the-world-company-inc.","isProfessional":true,"image":null,"averageRating":null}],"categoryPath":[{"id":5,"name":"Special category dedicated to specific tests","slug":"special-category-dedicated-to-specific-tests"}],"geolocation":null,"video":null,"declinations":[{"id":"5_0","code":"32094574920","isAvailable":true,"supplierReference":"TEST-ATTRIBUTES","price":15,"originalPrice":15,"crossedOutPrice":null,"prices":{"priceWithTaxes":15,"priceWithoutVat":14.69,"vat":0.31},"greenTax":0,"amount":15,"affiliateLink":null,"images":[],"options":[],"isBrandNew":true,"company":{"id":3,"name":"The World Company Inc.","slug":"the-world-company-inc.","isProfessional":true,"image":null,"averageRating":null}}],"attributes":[{"id":3,"name":"Commentaire","value":"Commentaire #12M%M_\u00b009\u00a3*\/.?","valueIds":[],"children":[],"subfeatures":[],"imageUrls":[],"type":"FREE_TEXT"},{"id":1,"name":"Couleur","value":["Blanc","Rouge"],"valueIds":[2,3],"children":[],"subfeatures":[],"imageUrls":[],"type":"CHECKBOX_MULTIPLE"},{"id":4,"name":"Groupe attributs","value":null,"valueIds":[],"children":[{"id":7,"name":"Compl\u00e9ment adresse","value":"Compl\u00e9ment d\u0027adresse pour la stepo","valueIds":[],"children":[],"subfeatures":[],"imageUrls":[],"type":"FREE_TEXT"},{"id":5,"name":"Couleur secondaire","value":["Orange"],"valueIds":[9],"children":[],"subfeatures":[],"imageUrls":[],"type":"CHECKBOX_MULTIPLE"},{"id":6,"name":"Pointure","value":["44"],"valueIds":[17],"children":[],"subfeatures":[],"imageUrls":[],"type":"LIST_TEXT"}],"subfeatures":[{"id":7,"name":"Compl\u00e9ment adresse","value":"Compl\u00e9ment d\u0027adresse pour la stepo","valueIds":[],"children":[],"subfeatures":[],"imageUrls":[],"type":"FREE_TEXT"},{"id":5,"name":"Couleur secondaire","value":["Orange"],"valueIds":[9],"children":[],"subfeatures":[],"imageUrls":[],"type":"CHECKBOX_MULTIPLE"},{"id":6,"name":"Pointure","value":["44"],"valueIds":[17],"children":[],"subfeatures":[],"imageUrls":[],"type":"LIST_TEXT"}],"imageUrls":[],"type":"GROUP"},{"id":9,"name":"Marque","value":["Puma"],"valueIds":[20],"children":[],"subfeatures":[],"imageUrls":[],"type":"LIST_BRAND"},{"id":2,"name":"Taille","value":["M"],"valueIds":[5],"children":[],"subfeatures":[],"imageUrls":[],"type":"LIST_TEXT"},{"id":null,"name":"Free attribute multiple","value":["r\u00e9ponse - 1 #","r\u00e9ponse - 2 @",4985],"valueIds":[],"children":[],"subfeatures":[],"imageUrls":null,"type":"FREE"},{"id":null,"name":"Free attribute simple","value":["valeur simple du free attribute #12M%M_\u00b009\u00a3*\/.?"],"valueIds":[],"children":[],"subfeatures":[],"imageUrls":null,"type":"FREE"},{"id":null,"name":"Free attribute simple mais en tableau","value":["une bien belle valeur d\u00e9j\u00e0 encapsul\u00e9e"],"valueIds":[],"children":[],"subfeatures":[],"imageUrls":null,"type":"FREE"},{"id":null,"name":"Free attribute integer ?","value":[92254094],"valueIds":[],"children":[],"subfeatures":[],"imageUrls":null,"type":"FREE"},{"id":null,"name":"Free attribute integer mais en tableau","value":["la m\u00eame histoire par ici"],"valueIds":[],"children":[],"subfeatures":[],"imageUrls":null,"type":"FREE"}],"options":[],"attachments":[]}'
-
request:
method: GET
url: 'http://wizaplace.loc/api/v1/catalog/attributes/variants/20'
headers:
Host: wizaplace.loc
VCR-index: '1'
response:
status:
http_version: '1.1'
code: '200'
message: OK
headers:
Date: 'Mon, 30 Oct 2017 09:36:39 GMT'
Server: 'Apache/2.4.10 (Debian)'
Cache-Control: 'no-cache, private'
Content-Language: fr
X-Debug-Token: a17343
X-Debug-Token-Link: 'http://wizaplace.loc/_profiler/a17343'
Content-Length: '83'
Content-Type: application/json
body: '{"id":20,"attributeId":9,"name":"Puma","slug":"puma","description":"","image":null}'
body: '{"id":5,"code":"7531596248952","supplierReference":"LOGITECH-CASQUE-GAMING","name":"Logitech G430 Casque Gaming pour PC Gaming, PS4, Xbox One with 7.1 Dolby Surround","url":"http:\/\/wizaplace.loc\/it\/headsets\/casque-logitech-gaming.html","shortDescription":"","description":"","slug":"casque-logitech-gaming","minPrice":61.5,"greenTax":0,"isTransactional":true,"weight":1.23,"averageRating":null,"shippings":[{"shipping_id":1,"name":"TNT Express","image":null,"firstRate":0,"nextRate":0,"deliveryTime":"24h"},{"shipping_id":38,"name":"Lettre prioritaire","image":null,"firstRate":0,"nextRate":0,"deliveryTime":""},{"shipping_id":39,"name":"Colissmo","image":null,"firstRate":0,"nextRate":0,"deliveryTime":""}],"companies":[{"id":3,"name":"The World Company Inc.","slug":"the-world-company-inc.","isProfessional":true,"image":null,"averageRating":null}],"categoryPath":[{"id":3,"name":"Informatique","slug":"it"},{"id":5,"name":"Casques","slug":"headsets"}],"geolocation":null,"createdAt":"2018-10-26T12:35:55+00:00","updatedAt":"2018-10-26T12:35:55+00:00","infiniteStock":false,"video":null,"seoData":{"title":"Micro-Casque Logitech Gaming","description":"","keywords":""},"declinations":[{"id":"5_0","code":"7531596248952","isAvailable":true,"supplierReference":"LOGITECH-CASQUE-GAMING","price":61.5,"originalPrice":61.5,"crossedOutPrice":null,"prices":{"priceWithTaxes":61.5,"priceWithoutVat":60.24,"vat":1.26},"greenTax":0,"amount":15,"infiniteStock":false,"affiliateLink":null,"images":[],"options":[],"isBrandNew":true,"company":{"id":3,"name":"The World Company Inc.","slug":"the-world-company-inc.","isProfessional":true,"image":null,"averageRating":null}}],"attributes":[],"options":[],"attachments":[],"images":[],"productTemplateType":"product","features":[]}'
2 changes: 1 addition & 1 deletion tests/Service/BasketServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public function testBasketsMergeOnAuthentication(): void
}

self::assertSame([
'1_0' => 2,
'1_0' => 3,
'3_3_7' => 1,
'3_3_8' => 1,
], $quantitiesMap);
Expand Down
Loading

0 comments on commit a5d7317

Please sign in to comment.