Skip to content

Add PHP 8.4 to CI and fix test method naming to follow camelCase convention #628

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: true
matrix:
php: ['8.1', '8.2', '8.3']
php: ['8.1', '8.2', '8.3', '8.4']
stability: ['prefer-lowest', 'prefer-stable']
laravel: ['^10.0', '^11.0', '^12.0']
exclude:
Expand Down
2 changes: 1 addition & 1 deletion pint.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"preset": "laravel",
"rules": {
"php_unit_method_casing": {
"case": "camel_case"
"case": "camel_case"
}
}
}
8 changes: 4 additions & 4 deletions tests/Feature/ConnectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

class ConnectorTest extends \VladimirYuldashev\LaravelQueueRabbitMQ\Tests\TestCase
{
public function test_lazy_connection(): void
public function testLazyConnection(): void
{
$this->app['config']->set('queue.connections.rabbitmq', [
'driver' => 'rabbitmq',
Expand Down Expand Up @@ -55,7 +55,7 @@ public function test_lazy_connection(): void
$this->assertTrue($connection->getConnection()->isConnected());
}

public function test_lazy_stream_connection(): void
public function testLazyStreamConnection(): void
{
$this->app['config']->set('queue.connections.rabbitmq', [
'driver' => 'rabbitmq',
Expand Down Expand Up @@ -98,7 +98,7 @@ public function test_lazy_stream_connection(): void
$this->assertTrue($connection->getConnection()->isConnected());
}

public function test_ssl_connection(): void
public function testSslConnection(): void
{
$this->markTestSkipped();

Expand Down Expand Up @@ -142,7 +142,7 @@ public function test_ssl_connection(): void
}

// Test to validate ssl connection params
public function test_no_verification_ssl_connection(): void
public function testNoVerificationSslConnection(): void
{
$this->app['config']->set('queue.connections.rabbitmq', [
'driver' => 'rabbitmq',
Expand Down
4 changes: 2 additions & 2 deletions tests/Feature/QueueTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ protected function setUp(): void
]);
}

public function test_connection(): void
public function testConnection(): void
{
$this->assertInstanceOf(AMQPStreamConnection::class, $this->connection()->getChannel()->getConnection());
}

public function test_without_reconnect(): void
public function testWithoutReconnect(): void
{
$queue = $this->connection('rabbitmq');

Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/SslQueueTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ protected function getEnvironmentSetUp($app): void
]);
}

public function test_connection(): void
public function testConnection(): void
{
$this->assertInstanceOf(AMQPSSLConnection::class, $this->connection()->getChannel()->getConnection());
}
Expand Down
38 changes: 19 additions & 19 deletions tests/Feature/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@ protected function tearDown(): void
parent::tearDown();
}

public function test_size_does_not_throw_exception_on_unknown_queue(): void
public function testSizeDoesNotThrowExceptionOnUnknownQueue(): void
{
$this->assertEmpty(0, Queue::size(Str::random()));
}

public function test_pop_nothing(): void
public function testPopNothing(): void
{
$this->assertNull(Queue::pop('foo'));
}

public function test_push_raw(): void
public function testPushRaw(): void
{
Queue::pushRaw($payload = Str::random());

Expand All @@ -68,7 +68,7 @@ public function test_push_raw(): void
$this->assertSame(0, Queue::size());
}

public function test_push(): void
public function testPush(): void
{
Queue::push(new TestJob);

Expand All @@ -95,7 +95,7 @@ public function test_push(): void
$this->assertSame(0, Queue::size());
}

public function test_push_after_commit(): void
public function testPushAfterCommit(): void
{
$transaction = new DatabaseTransactionsManager;

Expand All @@ -122,7 +122,7 @@ public function test_push_after_commit(): void
$this->assertSame(0, Queue::size());
}

public function test_later_raw(): void
public function testLaterRaw(): void
{
$payload = Str::random();
$data = [Str::random() => Str::random()];
Expand Down Expand Up @@ -152,7 +152,7 @@ public function test_later_raw(): void
$this->assertSame(0, Queue::size());
}

public function test_later(): void
public function testLater(): void
{
Queue::later(3, new TestJob);

Expand All @@ -179,7 +179,7 @@ public function test_later(): void
$this->assertSame(0, Queue::size());
}

public function test_bulk(): void
public function testBulk(): void
{
$count = 100;
$jobs = [];
Expand All @@ -195,7 +195,7 @@ public function test_bulk(): void
$this->assertSame($count, Queue::size());
}

public function test_push_encrypted(): void
public function testPushEncrypted(): void
{
Queue::push(new TestEncryptedJob);

Expand All @@ -222,7 +222,7 @@ public function test_push_encrypted(): void
$this->assertSame(0, Queue::size());
}

public function test_push_encrypted_after_commit(): void
public function testPushEncryptedAfterCommit(): void
{
$transaction = new DatabaseTransactionsManager;

Expand All @@ -249,7 +249,7 @@ public function test_push_encrypted_after_commit(): void
$this->assertSame(0, Queue::size());
}

public function test_encrypted_later(): void
public function testEncryptedLater(): void
{
Queue::later(3, new TestEncryptedJob);

Expand All @@ -276,7 +276,7 @@ public function test_encrypted_later(): void
$this->assertSame(0, Queue::size());
}

public function test_encrypted_bulk(): void
public function testEncryptedBulk(): void
{
$count = 100;
$jobs = [];
Expand All @@ -292,7 +292,7 @@ public function test_encrypted_bulk(): void
$this->assertSame($count, Queue::size());
}

public function test_release_raw(): void
public function testReleaseRaw(): void
{
Queue::pushRaw($payload = Str::random());

Expand All @@ -318,7 +318,7 @@ public function test_release_raw(): void
$this->assertSame(0, Queue::size());
}

public function test_release(): void
public function testRelease(): void
{
Queue::push(new TestJob);

Expand All @@ -344,7 +344,7 @@ public function test_release(): void
$this->assertSame(0, Queue::size());
}

public function test_release_with_delay_raw(): void
public function testReleaseWithDelayRaw(): void
{
Queue::pushRaw($payload = Str::random());

Expand Down Expand Up @@ -375,7 +375,7 @@ public function test_release_with_delay_raw(): void
$this->assertSame(0, Queue::size());
}

public function test_release_in_the_past(): void
public function testReleaseInThePast(): void
{
Queue::push(new TestJob);

Expand All @@ -390,7 +390,7 @@ public function test_release_in_the_past(): void
$this->assertSame(0, Queue::size());
}

public function test_release_and_release_with_delay_attempts(): void
public function testReleaseAndReleaseWithDelayAttempts(): void
{
Queue::push(new TestJob);

Expand All @@ -417,7 +417,7 @@ public function test_release_and_release_with_delay_attempts(): void
$this->assertSame(0, Queue::size());
}

public function test_delete(): void
public function testDelete(): void
{
Queue::push(new TestJob);

Expand All @@ -431,7 +431,7 @@ public function test_delete(): void
$this->assertNull(Queue::pop());
}

public function test_failed(): void
public function testFailed(): void
{
Queue::push(new TestJob);

Expand Down
28 changes: 14 additions & 14 deletions tests/Functional/RabbitMQQueueTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class RabbitMQQueueTest extends BaseTestCase
{
public function test_connection(): void
public function testConnection(): void
{
$queue = $this->connection();
$this->assertInstanceOf(RabbitMQQueue::class, $queue);
Expand All @@ -21,7 +21,7 @@ public function test_connection(): void
$this->assertInstanceOf(RabbitMQQueue::class, $queue);
}

public function test_config_reroute_failed(): void
public function testConfigRerouteFailed(): void
{
$queue = $this->connection();
$this->assertFalse($this->callProperty($queue, 'config')->isRerouteFailed());
Expand All @@ -36,7 +36,7 @@ public function test_config_reroute_failed(): void
$this->assertFalse($this->callProperty($queue, 'config')->isRerouteFailed());
}

public function test_config_prioritize_delayed(): void
public function testConfigPrioritizeDelayed(): void
{
$queue = $this->connection();
$this->assertFalse($this->callProperty($queue, 'config')->isPrioritizeDelayed());
Expand All @@ -51,7 +51,7 @@ public function test_config_prioritize_delayed(): void
$this->assertFalse($this->callProperty($queue, 'config')->isPrioritizeDelayed());
}

public function test_queue_max_priority(): void
public function testQueueMaxPriority(): void
{
$queue = $this->connection();
$this->assertIsInt($this->callProperty($queue, 'config')->getQueueMaxPriority());
Expand All @@ -70,7 +70,7 @@ public function test_queue_max_priority(): void
$this->assertSame(2, $this->callProperty($queue, 'config')->getQueueMaxPriority());
}

public function test_config_exchange_type(): void
public function testConfigExchangeType(): void
{
$queue = $this->connection();
$this->assertSame(AMQPExchangeType::DIRECT, $this->callMethod($queue, 'getExchangeType'));
Expand All @@ -92,7 +92,7 @@ public function test_config_exchange_type(): void
$this->assertSame(AMQPExchangeType::DIRECT, $this->callMethod($queue, 'getExchangeType'));
}

public function test_exchange(): void
public function testExchange(): void
{
$queue = $this->connection();
$this->assertSame('test', $this->callMethod($queue, 'getExchange', ['test']));
Expand All @@ -119,7 +119,7 @@ public function test_exchange(): void
$this->assertSame('', $this->callMethod($queue, 'getExchange', ['']));
}

public function test_failed_exchange(): void
public function testFailedExchange(): void
{
$queue = $this->connection();
$this->assertSame('test', $this->callMethod($queue, 'getFailedExchange', ['test']));
Expand All @@ -146,7 +146,7 @@ public function test_failed_exchange(): void
$this->assertSame('', $this->callMethod($queue, 'getFailedExchange', ['']));
}

public function test_routing_key(): void
public function testRoutingKey(): void
{
$queue = $this->connection();
$this->assertSame('test', $this->callMethod($queue, 'getRoutingKey', ['test']));
Expand All @@ -165,7 +165,7 @@ public function test_routing_key(): void
$this->assertSame('an.alternate.routing-key', $this->callMethod($queue, 'getRoutingKey', ['test']));
}

public function test_failed_routing_key(): void
public function testFailedRoutingKey(): void
{
$queue = $this->connection();
$this->assertSame('test.failed', $this->callMethod($queue, 'getFailedRoutingKey', ['test']));
Expand All @@ -184,7 +184,7 @@ public function test_failed_routing_key(): void
$this->assertSame('an.alternate.routing-key', $this->callMethod($queue, 'getFailedRoutingKey', ['test']));
}

public function test_config_quorum(): void
public function testConfigQuorum(): void
{
$queue = $this->connection();
$this->assertFalse($this->callProperty($queue, 'config')->isQuorum());
Expand All @@ -202,7 +202,7 @@ public function test_config_quorum(): void
$this->assertTrue($this->callProperty($queue, 'config')->isQuorum());
}

public function test_declare_delete_exchange(): void
public function testDeclareDeleteExchange(): void
{
$queue = $this->connection();

Expand All @@ -217,7 +217,7 @@ public function test_declare_delete_exchange(): void
$this->assertFalse($queue->isExchangeExists($name));
}

public function test_declare_delete_queue(): void
public function testDeclareDeleteQueue(): void
{
$queue = $this->connection();

Expand All @@ -232,7 +232,7 @@ public function test_declare_delete_queue(): void
$this->assertFalse($queue->isQueueExists($name));
}

public function test_queue_arguments(): void
public function testQueueArguments(): void
{
$name = Str::random();

Expand Down Expand Up @@ -272,7 +272,7 @@ public function test_queue_arguments(): void
$this->assertEquals(array_values($expected), array_values($actual));
}

public function test_delay_queue_arguments(): void
public function testDelayQueueArguments(): void
{
$name = Str::random();
$ttl = 12000;
Expand Down
4 changes: 2 additions & 2 deletions tests/Functional/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ protected function callProperty($object, string $property): mixed
return $property->getValue($object);
}

public function test_connect_channel(): void
public function testConnectChannel(): void
{
$queue = $this->connection();
$this->assertFalse($queue->getConnection()->isConnected());
Expand All @@ -248,7 +248,7 @@ public function test_connect_channel(): void
$this->assertTrue($channel->is_open());
}

public function test_reconnect(): void
public function testReconnect(): void
{
$queue = $this->connection();
$this->assertFalse($queue->getConnection()->isConnected());
Expand Down