Skip to content

Commit 012175e

Browse files
committed
Fix WebAPI tests
Signed-off-by: Denis Kopylov <[email protected]>
1 parent 46fdcb8 commit 012175e

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

dev/tests/api-functional/testsuite/Magento/Downloadable/Api/SampleRepositoryTest.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,17 @@ class SampleRepositoryTest extends WebapiAbstract
3636
*/
3737
protected $deleteServiceInfo;
3838

39+
/**
40+
* @var DomainManagerInterface
41+
*/
42+
private $domainManager;
43+
3944
protected function setUp(): void
4045
{
46+
$objectManager = Bootstrap::getObjectManager();
47+
$this->domainManager = $objectManager->get(DomainManagerInterface::class);
48+
$this->domainManager->addDomains(['example.com']);
49+
4150
$this->createServiceInfo = [
4251
'rest' => [
4352
'resourcePath' => '/V1/products/downloadable-product/downloadable-links/samples',
@@ -75,6 +84,15 @@ protected function setUp(): void
7584
$this->testImagePath = __DIR__ . str_replace('/', DIRECTORY_SEPARATOR, '/_files/test_image.jpg');
7685
}
7786

87+
/**
88+
* Remove example domain from whitelist and call parent restore configuration
89+
*/
90+
protected function tearDown(): void
91+
{
92+
parent::tearDown();
93+
$this->domainManager->removeDomains(['example.com']);
94+
}
95+
7896
/**
7997
* Retrieve product that was updated by test
8098
*

0 commit comments

Comments
 (0)