Skip to content

Commit 5dfaee7

Browse files
committed
Unit tests fixes
1 parent 69c1a71 commit 5dfaee7

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

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

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use Magento\Framework\ObjectManagerInterface;
1313
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
1414
use PhpAmqpLib\Connection\AMQPConnectionConfig;
15+
use PhpAmqpLib\Connection\AMQPStreamConnection;
1516
use PHPUnit\Framework\MockObject\MockObject;
1617
use PHPUnit\Framework\TestCase;
1718

@@ -98,18 +99,18 @@ public function testSSLConnection(bool $sslEnabled, string $connectionClass)
9899
->method('getSslOptions')
99100
->willReturn(null);
100101

101-
$connection = $this->objectManager->getObject($connectionClass, [
102-
'127.0.0.1',
103-
'5672',
104-
'guest',
105-
'guest',
106-
'/']
107-
);
108-
109102
$this->objectManagerInterface->expects($this->any())
110103
->method('create')
111-
->with($connectionClass)
112-
->willReturn($connection);
104+
->with(AMQPConnectionConfig::class)
105+
->willReturn(
106+
$this->objectManager->getObject(AMQPConnectionConfig::class, [
107+
'127.0.0.1',
108+
'5672',
109+
'guest',
110+
'guest',
111+
'/']
112+
)
113+
);
113114

114115
\Magento\Framework\App\ObjectManager::setInstance($this->objectManagerInterface);
115116

@@ -126,11 +127,11 @@ public static function connectionDataProvider()
126127
return [
127128
[
128129
'ssl_enabled' => true,
129-
'connection_class' => AMQPConnectionConfig::class,
130+
'connection_class' => AMQPStreamConnection::class,
130131
],
131132
[
132133
'ssl_enabled' => false,
133-
'connection_class' => AMQPConnectionConfig::class,
134+
'connection_class' => AMQPStreamConnection::class,
134135
],
135136
];
136137
}

0 commit comments

Comments
 (0)