Skip to content

Commit

Permalink
BB-13491: SS_ Adding Warehouse: duplicated queries from oro_website (…
Browse files Browse the repository at this point in the history
…#16454)

BB-13491: SS_ Adding Warehouse: duplicated queries from oro_website
 - functional tests fixed (regression)
  • Loading branch information
d-beekeeper committed Jan 31, 2018
1 parent 3b5f6bd commit e98e25c
Showing 1 changed file with 15 additions and 3 deletions.
Expand Up @@ -9,6 +9,9 @@
use Oro\Bundle\TestFrameworkBundle\Entity\TestEmployee;
use Oro\Bundle\TestFrameworkBundle\Entity\TestProduct;
use Oro\Bundle\TestFrameworkBundle\Test\WebTestCase;
use Oro\Bundle\WebsiteBundle\Entity\Repository\WebsiteRepository;
use Oro\Bundle\WebsiteBundle\Entity\Website;
use Oro\Bundle\WebsiteBundle\Provider\WebsiteProviderInterface;
use Oro\Bundle\WebsiteSearchBundle\Engine\AbstractIndexer;
use Oro\Bundle\WebsiteSearchBundle\Engine\IndexerInputValidator;
use Oro\Bundle\WebsiteSearchBundle\Engine\ORM\OrmIndexer;
Expand Down Expand Up @@ -45,7 +48,7 @@ public static function checkSearchEngine(WebTestCase $webTestCase)
$webTestCase->markTestSkipped('Should be tested only with ORM engine');
}
}

protected function preSetUp()
{
$this->checkEngine();
Expand All @@ -55,7 +58,7 @@ protected function preTearDown()
{
$this->checkEngine();
}

protected function checkEngine()
{
self::checkSearchEngine($this);
Expand All @@ -77,8 +80,17 @@ protected function setUp()
->disableOriginalConstructor()
->getMock();

/** @var WebsiteRepository $repo */
$repo = $this->getContainer()->get('oro_entity.doctrine_helper')->getEntityRepository(Website::class);
$websiteProvider = $this->createMock(WebsiteProviderInterface::class);
$websiteProvider->expects($this->any())
->method('getWebsiteIds')
->will($this->returnCallback(function () use ($repo) {
return $repo->getWebsiteIdentifiers();
}));

$inputValidator = new IndexerInputValidator(
$this->doctrineHelper,
$websiteProvider,
$this->mappingProviderMock
);

Expand Down

0 comments on commit e98e25c

Please sign in to comment.