/** * @magentoDataFixture Magento/Catalog/_files/product_simple.php */ public function testGetSearchableData() { $product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\\Catalog\\Model\\Product'); $product->load(1); // fixture $data = $this->_model->getSearchableData($product); $this->assertContains('Test Field', $data); $this->assertContains('Test Date and Time', $data); $this->assertContains('Test Select', $data); $this->assertContains('Test Radio', $data); $this->assertContains('Option 1', $data); $this->assertContains('Option 2', $data); }
/** * Retrieve additional searchable data from type instance * Using based on product id and store_id data * * @param \Magento\Catalog\Model\Product $product * @return array */ public function getSearchableData($product) { $searchData = parent::getSearchableData($product); $optionSearchData = $this->_bundleOption->create()->getSearchableData($product->getId(), $product->getStoreId()); if ($optionSearchData) { $searchData = array_merge($searchData, $optionSearchData); } return $searchData; }