Skip to content

Commit abbb944

Browse files
committed
Add PHP 8.4 tests
1 parent 4f745c4 commit abbb944

File tree

3 files changed

+21
-10
lines changed

3 files changed

+21
-10
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464

6565
- name: Install dependencies
6666
run: |
67-
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update
67+
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
6868
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
6969
7070
- name: Execute tests

tests/Unit/OptimusFactoryTest.php

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,12 @@ final class OptimusFactoryTest extends AbstractTestCase
2121
{
2222
public function testMakeStandard(): void
2323
{
24-
$factory = $this->getOptimusFactory();
25-
26-
$return = $factory->make([
24+
$instance = (new OptimusFactory())->make([
2725
'prime' => 0,
2826
'inverse' => 1,
2927
'random' => 2,
3028
]);
3129

32-
$this->assertInstanceOf(Optimus::class, $return);
33-
}
34-
35-
protected function getOptimusFactory(): OptimusFactory
36-
{
37-
return new OptimusFactory();
30+
$this->assertInstanceOf(Optimus::class, $instance);
3831
}
3932
}

tests/Unit/Providers/ServiceProviderTest.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ public function testOptimusManagerIsInjectable(): void
3535

3636
public function testBindings(): void
3737
{
38+
$this->configurePrimeNumbers();
39+
3840
$this->assertIsInjectable(Optimus::class);
3941

4042
$original = $this->app['optimus.connection'];
@@ -44,4 +46,20 @@ public function testBindings(): void
4446
$this->assertNotSame($original, $new);
4547
$this->assertEquals($original, $new);
4648
}
49+
50+
protected function configurePrimeNumbers(): void
51+
{
52+
config()->set('optimus.connections', [
53+
'main' => [
54+
'prime' => 1490261603,
55+
'inverse' => 1573362507,
56+
'random' => 1369544188,
57+
],
58+
'custom' => [
59+
'prime' => 1770719809,
60+
'inverse' => 1417283009,
61+
'random' => 508877541,
62+
],
63+
]);
64+
}
4765
}

0 commit comments

Comments
 (0)