Skip to content

Commit

Permalink
Merge pull request #60 from chelout/laravel-11
Browse files Browse the repository at this point in the history
Laravel 11
  • Loading branch information
chelout authored Mar 15, 2024
2 parents 2df4898 + 8173910 commit a3a1743
Show file tree
Hide file tree
Showing 12 changed files with 100 additions and 91 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
fail-fast: true
matrix:
php: [8.1, 8.2]
php: [8.2, 8.3]
stability: [prefer-lowest, prefer-stable]

name: P${{ matrix.php }} - S${{ matrix.stability }}
Expand Down
14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
}
],
"require": {
"php": "^8.1",
"illuminate/container": "^10.0",
"illuminate/database": "^10.0",
"illuminate/events": "^10.0",
"illuminate/support": "^10.0"
"php": "^8.2",
"illuminate/container": "^11.0",
"illuminate/database": "^11.0",
"illuminate/events": "^11.0",
"illuminate/support": "^11.0"
},
"require-dev": {
"phpunit/phpunit": "^9.6.0 || ^10.0.7",
"orchestra/testbench": "^8.0",
"phpunit/phpunit": "^10.5|^11.0",
"orchestra/testbench": "^9.0",
"friendsofphp/php-cs-fixer": "^3.14"
},
"scripts": {
Expand Down
12 changes: 6 additions & 6 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" bootstrap="vendor/autoload.php" colors="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
<coverage includeUncoveredFiles="true">
<include>
<directory suffix=".php">./src</directory>
</include>
</coverage>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" bootstrap="vendor/autoload.php" colors="true" processIsolation="false" stopOnFailure="false" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
<testsuites>
<testsuite name="Package Test Suite">
<directory suffix="Test.php">./tests/</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory suffix=".php">./src</directory>
</include>
</source>
</phpunit>
15 changes: 8 additions & 7 deletions tests/Feature/HasBelongsToEventsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

namespace Chelout\RelationshipEvents\Tests\Feature;

use PHPUnit\Framework\Attributes\Test;
use Chelout\RelationshipEvents\Tests\Stubs\Profile;
use Chelout\RelationshipEvents\Tests\Stubs\User;
use Chelout\RelationshipEvents\Tests\TestCase;
use Illuminate\Support\Facades\Event;

class HasBelongsToEventsTest extends TestCase
final class HasBelongsToEventsTest extends TestCase
{
public function setup(): void
{
Expand All @@ -17,8 +18,8 @@ public function setup(): void
Profile::setupTable();
}

/** @test */
public function it_fires_belongsToAssociating_and_belongsToAssociated_when_a_model_associated()
#[Test]
public function it_fires_belongsToAssociating_and_belongsToAssociated_when_a_model_associated(): void
{
Event::fake();

Expand All @@ -39,8 +40,8 @@ function ($event, $callback) use ($user, $profile) {
);
}

/** @test */
public function it_fires_belongsToDissociating_and_belongsToDissociated_when_a_model_dissociated()
#[Test]
public function it_fires_belongsToDissociating_and_belongsToDissociated_when_a_model_dissociated(): void
{
Event::fake();

Expand All @@ -62,8 +63,8 @@ function ($event, $callback) use ($user, $profile) {
);
}

/** @test */
public function it_fires_belongsToUpdating_and_belongsToUpdated_when_a_parent_model_updated()
#[Test]
public function it_fires_belongsToUpdating_and_belongsToUpdated_when_a_parent_model_updated(): void
{
Event::fake();

Expand Down
23 changes: 12 additions & 11 deletions tests/Feature/HasBelongsToManyEventsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

namespace Chelout\RelationshipEvents\Tests\Feature;

use PHPUnit\Framework\Attributes\Test;
use Chelout\RelationshipEvents\Tests\Stubs\Role;
use Chelout\RelationshipEvents\Tests\Stubs\User;
use Chelout\RelationshipEvents\Tests\TestCase;
use Illuminate\Support\Facades\Event;

class HasBelongsToManyEventsTest extends TestCase
final class HasBelongsToManyEventsTest extends TestCase
{
public function setup(): void
{
Expand All @@ -17,8 +18,8 @@ public function setup(): void
Role::setupTable();
}

/** @test */
public function it_fires_belongsToManyAttaching_and_belongsToManyAttached_when_a_model_attached()
#[Test]
public function it_fires_belongsToManyAttaching_and_belongsToManyAttached_when_a_model_attached(): void
{
Event::fake();

Expand All @@ -40,8 +41,8 @@ function ($event, $callback) use ($user, $role) {
);
}

/** @test */
public function it_fires_belongsToManyDetaching_and_belongsToManyDetached_when_a_model_detached()
#[Test]
public function it_fires_belongsToManyDetaching_and_belongsToManyDetached_when_a_model_detached(): void
{
Event::fake();

Expand All @@ -64,8 +65,8 @@ function ($event, $callback) use ($user, $role) {
);
}

/** @test */
public function it_fires_belongsToManySyncing_and_belongsToManySynced_when_a_model_synced()
#[Test]
public function it_fires_belongsToManySyncing_and_belongsToManySynced_when_a_model_synced(): void
{
Event::fake();

Expand All @@ -87,8 +88,8 @@ function ($event, $callback) use ($user, $role) {
);
}

/** @test */
public function it_fires_belongsToManyToggling_and_belongsToManyToggled_when_a_model_toggled()
#[Test]
public function it_fires_belongsToManyToggling_and_belongsToManyToggled_when_a_model_toggled(): void
{
Event::fake();

Expand All @@ -110,8 +111,8 @@ function ($event, $callback) use ($user, $role) {
);
}

/** @test */
public function it_fires_belongsToManyUpdatingExistingPivot_and_belongsToManyUpdatedExistingPivot_when_updaing_pivot_table()
#[Test]
public function it_fires_belongsToManyUpdatingExistingPivot_and_belongsToManyUpdatedExistingPivot_when_updaing_pivot_table(): void
{
Event::fake();

Expand Down
15 changes: 8 additions & 7 deletions tests/Feature/HasManyEventsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

namespace Chelout\RelationshipEvents\Tests\Feature;

use PHPUnit\Framework\Attributes\Test;
use Chelout\RelationshipEvents\Tests\Stubs\Post;
use Chelout\RelationshipEvents\Tests\Stubs\User;
use Chelout\RelationshipEvents\Tests\TestCase;
use Illuminate\Support\Facades\Event;

class HasManyEventsTest extends TestCase
final class HasManyEventsTest extends TestCase
{
public function setup(): void
{
Expand All @@ -17,8 +18,8 @@ public function setup(): void
Post::setupTable();
}

/** @test */
public function it_fires_hasManyCreating_and_hasManyCreated_when_belonged_model_with_many_created()
#[Test]
public function it_fires_hasManyCreating_and_hasManyCreated_when_belonged_model_with_many_created(): void
{
Event::fake();

Expand All @@ -39,8 +40,8 @@ function ($event, $callback) use ($user, $post) {
);
}

/** @test */
public function it_fires_hasManySaving_and_hasManySaved_when_belonged_model_with_many_saved()
#[Test]
public function it_fires_hasManySaving_and_hasManySaved_when_belonged_model_with_many_saved(): void
{
Event::fake();

Expand All @@ -61,8 +62,8 @@ function ($event, $callback) use ($user, $post) {
);
}

/** @test */
public function it_fires_hasManyUpdating_and_hasManyUpdated_when_belonged_model_with_many_updated()
#[Test]
public function it_fires_hasManyUpdating_and_hasManyUpdated_when_belonged_model_with_many_updated(): void
{
Event::fake();

Expand Down
15 changes: 8 additions & 7 deletions tests/Feature/HasMorphManyEventsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

namespace Chelout\RelationshipEvents\Tests\Feature;

use PHPUnit\Framework\Attributes\Test;
use Chelout\RelationshipEvents\Tests\Stubs\Comment;
use Chelout\RelationshipEvents\Tests\Stubs\Post;
use Chelout\RelationshipEvents\Tests\TestCase;
use Illuminate\Support\Facades\Event;

class HasMorphManyEventsTest extends TestCase
final class HasMorphManyEventsTest extends TestCase
{
public function setup(): void
{
Expand All @@ -17,8 +18,8 @@ public function setup(): void
Comment::setupTable();
}

/** @test */
public function it_fires_morphManyCreating_and_morphManyCreated_when_belonged_model_with_morph_many_created()
#[Test]
public function it_fires_morphManyCreating_and_morphManyCreated_when_belonged_model_with_morph_many_created(): void
{
Event::fake();

Expand All @@ -39,8 +40,8 @@ function ($event, $callback) use ($post, $comment) {
);
}

/** @test */
public function it_fires_morphManySaving_and_morphManySaved_when_belonged_model_with_morph_many_saved()
#[Test]
public function it_fires_morphManySaving_and_morphManySaved_when_belonged_model_with_morph_many_saved(): void
{
Event::fake();

Expand All @@ -61,8 +62,8 @@ function ($event, $callback) use ($post, $comment) {
);
}

/** @test */
public function it_fires_morphManyUpdating_and_morphManyUpdated_when_belonged_model_with_morph_many_updated()
#[Test]
public function it_fires_morphManyUpdating_and_morphManyUpdated_when_belonged_model_with_morph_many_updated(): void
{
Event::fake();

Expand Down
15 changes: 8 additions & 7 deletions tests/Feature/HasMorphOneEventsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

namespace Chelout\RelationshipEvents\Tests\Feature;

use PHPUnit\Framework\Attributes\Test;
use Chelout\RelationshipEvents\Tests\Stubs\Address;
use Chelout\RelationshipEvents\Tests\Stubs\User;
use Chelout\RelationshipEvents\Tests\TestCase;
use Illuminate\Support\Facades\Event;

class HasMorphOneEventsTest extends TestCase
final class HasMorphOneEventsTest extends TestCase
{
public function setup(): void
{
Expand All @@ -17,8 +18,8 @@ public function setup(): void
Address::setupTable();
}

/** @test */
public function it_fires_morphOneCreating_and_morphOneCreated_when_belonged_model_with_morph_one_created()
#[Test]
public function it_fires_morphOneCreating_and_morphOneCreated_when_belonged_model_with_morph_one_created(): void
{
Event::fake();

Expand All @@ -39,8 +40,8 @@ function ($event, $callback) use ($user, $address) {
);
}

/** @test */
public function it_fires_morphOneSaving_and_morphOneSaved_when_belonged_model_with_morph_one_saved()
#[Test]
public function it_fires_morphOneSaving_and_morphOneSaved_when_belonged_model_with_morph_one_saved(): void
{
Event::fake();

Expand All @@ -61,8 +62,8 @@ function ($event, $callback) use ($user, $address) {
);
}

/** @test */
public function it_fires_morphOneUpdating_and_morphOneUpdated_when_belonged_model_with_morph_one_updated()
#[Test]
public function it_fires_morphOneUpdating_and_morphOneUpdated_when_belonged_model_with_morph_one_updated(): void
{
Event::fake();

Expand Down
15 changes: 8 additions & 7 deletions tests/Feature/HasMorphToEventsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

namespace Chelout\RelationshipEvents\Tests\Feature;

use PHPUnit\Framework\Attributes\Test;
use Chelout\RelationshipEvents\Tests\Stubs\Comment;
use Chelout\RelationshipEvents\Tests\Stubs\Post;
use Chelout\RelationshipEvents\Tests\TestCase;
use Illuminate\Support\Facades\Event;

class HasMorphToEventsTest extends TestCase
final class HasMorphToEventsTest extends TestCase
{
public function setup(): void
{
Expand All @@ -17,8 +18,8 @@ public function setup(): void
Comment::setupTable();
}

/** @test */
public function it_fires_morphToAssociating_and_morphToAssociated()
#[Test]
public function it_fires_morphToAssociating_and_morphToAssociated(): void
{
Event::fake();

Expand All @@ -40,8 +41,8 @@ function ($event, $callback) use ($post, $comment) {
);
}

/** @test */
public function it_fires_morphToDissociating_and_morphToDissociated()
#[Test]
public function it_fires_morphToDissociating_and_morphToDissociated(): void
{
Event::fake();

Expand All @@ -64,8 +65,8 @@ function ($event, $callback) use ($post, $comment) {
);
}

/** @test */
public function it_fires_morphToUpdating_and_morphToUpdated()
#[Test]
public function it_fires_morphToUpdating_and_morphToUpdated(): void
{
Event::fake();

Expand Down
Loading

0 comments on commit a3a1743

Please sign in to comment.