33namespace Commercetools \Core \IntegrationTests \Product ;
44
55use Commercetools \Core \Builder \Request \RequestBuilder ;
6- use Commercetools \Core \Error \NotFoundException ;
76use Commercetools \Core \IntegrationTests \ApiTestCase ;
87use Commercetools \Core \Model \Product \Product ;
98use 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