Skip to content

Commit e6321f0

Browse files
committed
refactoring of unit test
1 parent c635446 commit e6321f0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/internal/Magento/Framework/Amqp/Test/Unit/Connection/FactoryTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class FactoryTest extends TestCase
3636
protected function setUp(): void
3737
{
3838
$this->amqpStreamConnectionMock = $this->createMock(AMQPStreamConnection::class);
39+
// Since final class AMQPConnectionConfig cannot be mocked, hence mocking the Factory class
3940
$this->factoryMock = $this->createMock(Factory::class);
4041
$this->optionsMock = $this->createMock(FactoryOptions::class);
4142
}
@@ -55,13 +56,13 @@ public function testSSLConnection(bool $sslEnabled, string $connectionClass)
5556
$this->optionsMock->method('getPassword')->willReturn('guest');
5657
$this->optionsMock->method('getVirtualHost')->willReturn('/');
5758

58-
// Since final class AMQPConnectionConfig cannot be mocked, hence mocking the Factory class
5959
$this->factoryMock->expects($this->once())
6060
->method('create')
6161
->with($this->optionsMock)
6262
->willReturn($this->amqpStreamConnectionMock);
6363

6464
$connection = $this->factoryMock->create($this->optionsMock);
65+
6566
$this->assertInstanceOf($connectionClass, $connection);
6667
}
6768

0 commit comments

Comments
 (0)