Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 689c70a

Browse files
committed
Fix more attributes and nullables
1 parent 6938300 commit 689c70a

File tree

10 files changed

+20
-5
lines changed

10 files changed

+20
-5
lines changed

pkg/amqp-bunny/Tests/AmqpConnectionFactoryTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@
55
use Enqueue\AmqpBunny\AmqpConnectionFactory;
66
use Enqueue\AmqpTools\RabbitMqDlxDelayStrategy;
77
use Enqueue\Test\ClassExtensionTrait;
8+
use Enqueue\Test\ReadAttributeTrait;
89
use Interop\Queue\ConnectionFactory;
910
use PHPUnit\Framework\TestCase;
1011

1112
class AmqpConnectionFactoryTest extends TestCase
1213
{
1314
use ClassExtensionTrait;
15+
use ReadAttributeTrait;
1416

1517
public function testShouldImplementConnectionFactoryInterface()
1618
{

pkg/amqp-lib/Tests/AmqpConnectionFactoryTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@
55
use Enqueue\AmqpLib\AmqpConnectionFactory;
66
use Enqueue\AmqpTools\RabbitMqDlxDelayStrategy;
77
use Enqueue\Test\ClassExtensionTrait;
8+
use Enqueue\Test\ReadAttributeTrait;
89
use Interop\Queue\ConnectionFactory;
910
use PHPUnit\Framework\TestCase;
1011

1112
class AmqpConnectionFactoryTest extends TestCase
1213
{
1314
use ClassExtensionTrait;
15+
use ReadAttributeTrait;
1416

1517
public function testShouldImplementConnectionFactoryInterface()
1618
{

pkg/dbal/Tests/DbalConnectionFactoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function testShouldCreateLazyContext()
2828
$this->assertInstanceOf(DbalContext::class, $context);
2929

3030
$this->assertAttributeEquals(null, 'connection', $context);
31-
$this->assertAttributeInternalType('callable', 'connectionFactory', $context);
31+
$this->assertIsCallable($this->readAttribute($context, 'connectionFactory'));
3232
}
3333

3434
public function testShouldParseGenericDSN()

pkg/dbal/Tests/ManagerRegistryConnectionFactoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public function testShouldCreateLazyContext()
7373
$this->assertInstanceOf(DbalContext::class, $context);
7474

7575
$this->assertAttributeEquals(null, 'connection', $context);
76-
$this->assertAttributeInternalType('callable', 'connectionFactory', $context);
76+
$this->assertIsCallable($this->readAttribute($context, 'connectionFactory'));
7777
}
7878

7979
/**

pkg/enqueue/Tests/Consumption/QueueConsumerTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1537,6 +1537,9 @@ private function createExtension()
15371537
*/
15381538
private function createConsumerStub($queue = null): Consumer
15391539
{
1540+
if ($queue === null) {
1541+
$queue = 'queue';
1542+
}
15401543
if (is_string($queue)) {
15411544
$queue = new NullQueue($queue);
15421545
}

pkg/enqueue/Tests/Symfony/Client/ConsumeCommandTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -677,6 +677,9 @@ private function createExtension()
677677
*/
678678
private function createConsumerStub($queue = null): Consumer
679679
{
680+
if ($queue === null) {
681+
$queue = 'queue';
682+
}
680683
if (is_string($queue)) {
681684
$queue = new NullQueue($queue);
682685
}

pkg/enqueue/Tests/Symfony/Consumption/ConsumeCommandTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,9 @@ private function createExtension()
221221
*/
222222
private function createConsumerStub($queue = null): Consumer
223223
{
224+
if ($queue === null) {
225+
$queue = 'queue';
226+
}
224227
if (is_string($queue)) {
225228
$queue = new NullQueue($queue);
226229
}

pkg/fs/Tests/LegacyFilesystemLockTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@
66
use Enqueue\Fs\LegacyFilesystemLock;
77
use Enqueue\Fs\Lock;
88
use Enqueue\Test\ClassExtensionTrait;
9+
use Enqueue\Test\ReadAttributeTrait;
910
use Makasim\File\TempFile;
1011
use PHPUnit\Framework\TestCase;
1112

1213
class LegacyFilesystemLockTest extends TestCase
1314
{
1415
use ClassExtensionTrait;
16+
use ReadAttributeTrait;
1517

1618
public function testShouldImplementLockInterface()
1719
{

pkg/redis/Tests/RedisProducerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function testShouldCallLPushOnSend()
6767
$this->assertNotEmpty($message['headers']['message_id']);
6868
$this->assertSame(0, $message['headers']['attempts']);
6969

70-
return true;
70+
return 1;
7171
})
7272
;
7373

pkg/stomp/Tests/StompConsumerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -523,8 +523,8 @@ public function testShouldGenerateUniqueSubscriptionIdPerConsumer()
523523
$fooConsumer = new StompConsumer($this->createStompClientMock(), $destination);
524524
$barConsumer = new StompConsumer($this->createStompClientMock(), $destination);
525525

526-
$this->assertAttributeNotEmpty('subscriptionId', $fooConsumer);
527-
$this->assertAttributeNotEmpty('subscriptionId', $barConsumer);
526+
$this->assertNotEmpty($this->readAttribute($fooConsumer, 'subscriptionId'));
527+
$this->assertNotEmpty($this->readAttribute($barConsumer, 'subscriptionId'));
528528

529529
$fooSubscriptionId = $this->readAttribute($fooConsumer, 'subscriptionId');
530530
$barSubscriptionId = $this->readAttribute($barConsumer, 'subscriptionId');

0 commit comments

Comments
 (0)