Skip to content

Commit f2c2a3d

Browse files
authored
fixing unit test (#722)
1 parent a3df993 commit f2c2a3d

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

app/code/Meta/BusinessExtension/Test/Unit/Api/CustomApiKey/CustomApiKeyTest.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Meta\BusinessExtension\Model\System\Config as SystemConfig;
1010
use PHPUnit\Framework\MockObject\MockObject;
1111
use PHPUnit\Framework\TestCase;
12+
use Meta\BusinessExtension\Helper\FBEHelper;
1213

1314
class CustomApiKeyTest extends TestCase
1415
{
@@ -27,6 +28,11 @@ class CustomApiKeyTest extends TestCase
2728
*/
2829
private SystemConfig $systemConfig;
2930

31+
/**
32+
* @var MockObject
33+
*/
34+
private FBEHelper $fbeHelper;
35+
3036
protected function setUp(): void
3137
{
3238
parent::setUp();
@@ -39,6 +45,9 @@ protected function setUp(): void
3945
$this->systemConfig = $this->getMockBuilder(SystemConfig::class)
4046
->disableOriginalConstructor()
4147
->getMock();
48+
$this->fbeHelper = $this->getMockBuilder(FBEHelper::class)
49+
->disableOriginalConstructor()
50+
->getMock();
4251
}
4352

4453
public function testAuthenticateApiKeyFailed()
@@ -58,7 +67,8 @@ public function testAuthenticateApiKeyFailed()
5867
$authenticator = new Authenticator(
5968
$this->scopeConfig,
6069
$this->httpRequest,
61-
$this->systemConfig
70+
$this->systemConfig,
71+
$this->fbeHelper
6272
);
6373
$authenticator->authenticateRequestDangerouslySkipSignatureValidation();
6474
}
@@ -77,7 +87,8 @@ public function testAuthenticateApiKeySuccess()
7787
$authenticator = new Authenticator(
7888
$this->scopeConfig,
7989
$this->httpRequest,
80-
$this->systemConfig
90+
$this->systemConfig,
91+
$this->fbeHelper
8192
);
8293
$authenticator->authenticateRequestDangerouslySkipSignatureValidation();
8394
}

0 commit comments

Comments
 (0)