Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions src/Queue/AMQPCreateInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ final class AMQPCreateInfo extends CreateInfo
public const MULTIPLE_ACK_DEFAULT_VALUE = false;
public const REQUEUE_ON_FAIL_DEFAULT_VALUE = false;
public const DURABLE_DEFAULT_VALUE = false;
public const CONSUME_ALL_DEFAULT_VALUE = false;
public const QUEUE_HEADERS_DEFAULT_VALUE = [];
public const DELETE_QUEUE_ON_STOP_DEFAULT_VALUE = false;
public const REDIAL_TIMEOUT_DEFAULT_VALUE = 60;
Expand Down Expand Up @@ -49,7 +48,6 @@ public function __construct(
public readonly bool $requeueOnFail = self::REQUEUE_ON_FAIL_DEFAULT_VALUE,
public readonly bool $durable = self::DURABLE_DEFAULT_VALUE,
public readonly bool $exchangeDurable = self::EXCHANGE_DURABLE_DEFAULT_VALUE,
public readonly bool $consumeAll = self::CONSUME_ALL_DEFAULT_VALUE,
public readonly array $queueHeaders = self::QUEUE_HEADERS_DEFAULT_VALUE,
public readonly bool $deleteQueueOnStop = self::DELETE_QUEUE_ON_STOP_DEFAULT_VALUE,
public readonly int $redialTimeout = self::REDIAL_TIMEOUT_DEFAULT_VALUE,
Expand Down Expand Up @@ -83,7 +81,6 @@ public function toArray(): array
'multiple_ack' => $this->multipleAck,
'requeue_on_fail' => $this->requeueOnFail,
'durable' => $this->durable,
'consume_all' => $this->consumeAll,
'delete_queue_on_stop' => $this->deleteQueueOnStop,
'redial_timeout' => $this->redialTimeout,
]);
Expand Down
3 changes: 0 additions & 3 deletions src/Queue/BeanstalkCreateInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ final class BeanstalkCreateInfo extends CreateInfo
public const TUBE_PRIORITY_MAX_VALUE = 2 ** 32;
public const TUBE_DEFAULT_VALUE = 'default';
public const RESERVE_TIMEOUT_DEFAULT_VALUE = 5;
public const CONSUME_ALL_DEFAULT_VALUE = false;

/**
* @param non-empty-string $name
Expand All @@ -28,7 +27,6 @@ public function __construct(
public readonly int $tubePriority = self::TUBE_PRIORITY_DEFAULT_VALUE,
public readonly string $tube = self::TUBE_DEFAULT_VALUE,
public readonly int $reserveTimeout = self::RESERVE_TIMEOUT_DEFAULT_VALUE,
public readonly bool $consumeAll = self::CONSUME_ALL_DEFAULT_VALUE,
) {
parent::__construct(Driver::Beanstalk, $name, $priority);

Expand All @@ -43,7 +41,6 @@ public function toArray(): array
'tube_priority' => $this->tubePriority,
'tube' => $this->tube,
'reserve_timeout' => $this->reserveTimeout,
'consume_all' => $this->consumeAll,
]);
}
}
5 changes: 0 additions & 5 deletions tests/Unit/Queue/AMQPCreateInfoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ public function testDefaultValues(): void
$this->assertFalse($amqpCreateInfo->requeueOnFail);
$this->assertFalse($amqpCreateInfo->durable);
$this->assertSame(AMQPCreateInfo::EXCHANGE_DURABLE_DEFAULT_VALUE, $amqpCreateInfo->exchangeDurable);
$this->assertSame(AMQPCreateInfo::CONSUME_ALL_DEFAULT_VALUE, $amqpCreateInfo->consumeAll);
$this->assertSame(AMQPCreateInfo::QUEUE_HEADERS_DEFAULT_VALUE, $amqpCreateInfo->queueHeaders);
$this->assertSame(AMQPCreateInfo::DELETE_QUEUE_ON_STOP_DEFAULT_VALUE, $amqpCreateInfo->deleteQueueOnStop);
$this->assertSame(AMQPCreateInfo::REDIAL_TIMEOUT_DEFAULT_VALUE, $amqpCreateInfo->redialTimeout);
Expand All @@ -50,7 +49,6 @@ public function testCustomValues(): void
requeueOnFail: true,
durable: true,
exchangeDurable: true,
consumeAll: true,
queueHeaders: [
'x-queue-type' => 'quorum',
],
Expand All @@ -71,7 +69,6 @@ public function testCustomValues(): void
$this->assertTrue($amqpCreateInfo->requeueOnFail);
$this->assertTrue($amqpCreateInfo->durable);
$this->assertTrue($amqpCreateInfo->exchangeDurable);
$this->assertTrue($amqpCreateInfo->consumeAll);
$this->assertSame(['x-queue-type' => 'quorum'], $amqpCreateInfo->queueHeaders);
$this->assertTrue($amqpCreateInfo->deleteQueueOnStop);
$this->assertSame(10, $amqpCreateInfo->redialTimeout);
Expand All @@ -95,7 +92,6 @@ public function testToArray(): void
requeueOnFail: true,
durable: true,
exchangeDurable: true,
consumeAll: true,
queueHeaders: [
'x-queue-type' => 'quorum',
],
Expand All @@ -120,7 +116,6 @@ public function testToArray(): void
'requeue_on_fail' => true,
'durable' => true,
'exchange_durable' => true,
'consume_all' => true,
'queue_headers' => [
'x-queue-type' => 'quorum',
],
Expand Down
11 changes: 2 additions & 9 deletions tests/Unit/Queue/BeanstalkCreateInfoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ public function testConstructor(): void
$this->assertEquals(BeanstalkCreateInfo::TUBE_PRIORITY_DEFAULT_VALUE, $beanstalkCreateInfo->tubePriority);
$this->assertEquals(BeanstalkCreateInfo::TUBE_DEFAULT_VALUE, $beanstalkCreateInfo->tube);
$this->assertEquals(BeanstalkCreateInfo::RESERVE_TIMEOUT_DEFAULT_VALUE, $beanstalkCreateInfo->reserveTimeout);
$this->assertEquals(BeanstalkCreateInfo::CONSUME_ALL_DEFAULT_VALUE, $beanstalkCreateInfo->consumeAll);
}

public function testBeanstalkCreateInfoCustomValues(): void
Expand All @@ -31,15 +30,13 @@ public function testBeanstalkCreateInfoCustomValues(): void
$tubePriority = 100;
$tube = 'my-tube';
$reserveTimeout = 30;
$consumeAll = true;

$beanstalkCreateInfo = new BeanstalkCreateInfo(
name: $name,
priority: $priority,
tubePriority: $tubePriority,
tube: $tube,
reserveTimeout: $reserveTimeout,
consumeAll: $consumeAll
reserveTimeout: $reserveTimeout
);

$this->assertEquals(Driver::Beanstalk, $beanstalkCreateInfo->driver);
Expand All @@ -48,7 +45,6 @@ public function testBeanstalkCreateInfoCustomValues(): void
$this->assertEquals($tubePriority, $beanstalkCreateInfo->tubePriority);
$this->assertEquals($tube, $beanstalkCreateInfo->tube);
$this->assertEquals($reserveTimeout, $beanstalkCreateInfo->reserveTimeout);
$this->assertEquals($consumeAll, $beanstalkCreateInfo->consumeAll);
}

public function testToArray(): void
Expand All @@ -58,15 +54,13 @@ public function testToArray(): void
$tubePriority = 100;
$tube = 'my-tube';
$reserveTimeout = 30;
$consumeAll = true;

$beanstalkCreateInfo = new BeanstalkCreateInfo(
name: $name,
priority: $priority,
tubePriority: $tubePriority,
tube: $tube,
reserveTimeout: $reserveTimeout,
consumeAll: $consumeAll
reserveTimeout: $reserveTimeout
);

$expectedArray = [
Expand All @@ -76,7 +70,6 @@ public function testToArray(): void
'tube_priority' => $tubePriority,
'tube' => $tube,
'reserve_timeout' => $reserveTimeout,
'consume_all' => $consumeAll,
];

$this->assertEquals($expectedArray, $beanstalkCreateInfo->toArray());
Expand Down