File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 10
10
use Magento \Catalog \Api \Data \CategoryInterface ;
11
11
use Magento \Catalog \Model \ResourceModel \Category \Collection as CategoryCollection ;
12
12
use Magento \Framework \DataObject ;
13
+ use Magento \Framework \GraphQl \Exception \GraphQlNoSuchEntityException ;
13
14
use Magento \TestFramework \TestCase \GraphQlAbstract ;
14
15
use Magento \Catalog \Api \Data \ProductInterface ;
15
16
use Magento \Catalog \Api \ProductRepositoryInterface ;
16
17
use Magento \TestFramework \ObjectManager ;
17
18
19
+
18
20
class CategoryTest extends GraphQlAbstract
19
21
{
20
22
/**
@@ -122,9 +124,9 @@ public function testNonExistentCategoryWithProductCount()
122
124
}
123
125
QUERY ;
124
126
125
- $ response = $ this ->graphQlQuery ( $ query );
126
- $ expectedResponse = [ ' errors ' => [ ' message ' => ' Category doesn \'t exist ']] ;
127
- $ this ->assertEquals ( $ expectedResponse , $ response );
127
+ $ this ->expectException (GraphQlNoSuchEntityException::class );
128
+ $ this -> expectExceptionMessage ( ' GraphQL response contains errors: Category doesn \'t exist ') ;
129
+ $ this ->graphQlQuery ( $ query );
128
130
}
129
131
130
132
/**
You can’t perform that action at this time.
0 commit comments