/** * Test when getting products from multiple categories. */ public function testGettingProductsFromMultipleCategories() { /** * @var $rootCategory CategoryInterface */ $rootCategory = $this->categoryRepository->findOneBy(['slug' => 'root-category']); $category = $this->categoryRepository->findOneBy(['slug' => 'category']); $products = $this->productRepository->getAllFromCategories([$rootCategory, $category]); $this->assertCount(3, $products, 'It should only return one product on the root category'); }