Important

You are browsing the documentation for version 4.1 of OroCommerce, OroCRM and OroPlatform, which is no longer maintained. Read version 5.1 (the latest LTS version) of the Oro documentation to get up-to-date information.

See our Release Process documentation for more information on the currently supported and upcoming releases.

Testing

Trait WebsiteSearchExtensionTrait сontains methods which help reindex data in test if required.

Example of usage:

 1 /**
 2  * @dbIsolationPerTest
 3  */
 4 class ReindexRequiredTest extends FrontendWebTestCase
 5 {
 6     use WebsiteSearchExtensionTrait;
 7
 8      /** {@inheritdoc} */
 9         protected function setUp(): void
10         {
11             ...
12
13             $this->reindexProductData(); // if we need re-index product data in every test
14         }
15
16         public function testExampleReindexData()
17         {
18             $this->reindexProductData(); // if we need re-index product data in specific test
19             ...
20         }
21 }