Skip to content
This repository was archived by the owner on Oct 24, 2023. It is now read-only.

Commit cbe7574

Browse files
author
Barbara Palumbo
committed
WIP: tests updated
1 parent 448a009 commit cbe7574

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

tests/integration/Product/ProductHeadRequestTest.php

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace Commercetools\Core\IntegrationTests\Product;
44

55
use Commercetools\Core\Builder\Request\RequestBuilder;
6-
use Commercetools\Core\Error\NotFoundException;
76
use Commercetools\Core\IntegrationTests\ApiTestCase;
87
use Commercetools\Core\Model\Product\Product;
98
use Commercetools\Core\Model\Product\ProductDraft;
@@ -13,11 +12,15 @@ class ProductHeadRequestTest extends ApiTestCase
1312
public function testProductsExist()
1413
{
1514
$client = $this->getApiClient();
15+
ProductFixture::withProduct(
16+
$client,
17+
function (Product $product) use ($client) {
18+
$request = RequestBuilder::of()->products()->head();
19+
$response = $this->execute($client, $request);
1620

17-
$request = RequestBuilder::of()->products()->head();
18-
$response = $this->execute($client, $request);
19-
20-
$this->assertSame(200, $response->getStatusCode());
21+
$this->assertSame(200, $response->getStatusCode());
22+
}
23+
);
2124
}
2225

2326
public function testProductByIdExists()
@@ -35,7 +38,7 @@ function (Product $product) use ($client) {
3538
);
3639
}
3740

38-
public function testProductByIdNotExists()
41+
public function testProductByIdDoesNotExists()
3942
{
4043
$this->expectExceptionCode(404);
4144
$client = $this->getApiClient();
@@ -62,7 +65,7 @@ function (Product $product) use ($client) {
6265
);
6366
}
6467

65-
public function testProductByKeyNotExists()
68+
public function testProductByKeyDoesNotExists()
6669
{
6770
$this->expectExceptionCode(404);
6871
$client = $this->getApiClient();
@@ -87,7 +90,7 @@ function (Product $product) use ($client) {
8790
);
8891
}
8992

90-
public function testProductByQueryPredicateNotExists()
93+
public function testProductByQueryPredicateDoesNotExists()
9194
{
9295
$this->expectExceptionCode(404);
9396
$client = $this->getApiClient();

0 commit comments

Comments
 (0)