Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Can Demiralp committed Nov 6, 2024
1 parent 4e77ed4 commit 76dc74b
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions Test/Unit/Model/ConfigurationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@

namespace Adyen\Hyva\Test\Unit\Model;

use Adyen\Hyva\Model\CompositeConfigProvider;
use Adyen\Hyva\Model\Configuration;
use Adyen\Payment\Test\Unit\AbstractAdyenTestCase;
use Magento\Checkout\Model\CompositeConfigProvider;
use Magento\Framework\DataObjectFactory;
use Psr\Log\LoggerInterface;
use PHPUnit\Framework\MockObject\MockObject;

class ConfigurationTest extends AbstractAdyenTestCase
{
private Configuration $configuration;
private CompositeConfigProvider|MockObject $configProvider;
private DataObjectFactory|MockObject $dataObjectFactory;
private LoggerInterface|MockObject $logger;
protected Configuration $configuration;
protected CompositeConfigProvider|MockObject $configProvider;
protected DataObjectFactory|MockObject $dataObjectFactory;
protected LoggerInterface|MockObject $logger;

protected function setUp(): void
{
Expand All @@ -26,13 +26,9 @@ protected function setUp(): void
]
];

$this->configProvider = $this->getMockBuilder(CompositeConfigProvider::class)
->disableOriginalConstructor()
->getMock();
$this->configProvider = $this->createMock(CompositeConfigProvider::class);
$this->dataObjectFactory = $this->createGeneratedMock(DataObjectFactory::class, ['create']);
$this->logger = $this->getMockBuilder(LoggerInterface::class)
->disableOriginalConstructor()
->getMock();
$this->logger = $this->createMock(LoggerInterface::class);

$this->configProvider->expects($this->exactly(2))
->method('getConfig')
Expand Down Expand Up @@ -74,6 +70,7 @@ public function testGetJsonValue(): void
$jsonValue = $this->configuration->getJsonValue('nonexistent/path');
$this->assertSame('null', $jsonValue);
}

public function testIsCCEnableStoreDetails(): void
{
$result = $this->configuration->isCCEnableStoreDetails(false);
Expand Down

0 comments on commit 76dc74b

Please sign in to comment.