diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryTest.php index c586665a16d51..187d3b80e4126 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryTest.php @@ -10,11 +10,13 @@ use Magento\Catalog\Api\Data\CategoryInterface; use Magento\Catalog\Model\ResourceModel\Category\Collection as CategoryCollection; use Magento\Framework\DataObject; +use Magento\Framework\GraphQl\Exception\GraphQlNoSuchEntityException; use Magento\TestFramework\TestCase\GraphQlAbstract; use Magento\Catalog\Api\Data\ProductInterface; use Magento\Catalog\Api\ProductRepositoryInterface; use Magento\TestFramework\ObjectManager; + class CategoryTest extends GraphQlAbstract { /** @@ -122,9 +124,9 @@ public function testNonExistentCategoryWithProductCount() } QUERY; - $response = $this->graphQlQuery($query); - $expectedResponse = ['errors' => ['message' => 'Category doesn\'t exist']]; - $this->assertEquals($expectedResponse, $response); + $this->expectException(GraphQlNoSuchEntityException::class); + $this->expectExceptionMessage('GraphQL response contains errors: Category doesn\'t exist'); + $this->graphQlQuery($query); } /**