Skip to content
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

PHPUnit 10 Shift #59

Merged
merged 4 commits into from
Mar 15, 2024
Merged
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
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
19 changes: 10 additions & 9 deletions tests/Feature/HasMorphToManyEventsTest.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\Tag;
use Chelout\RelationshipEvents\Tests\TestCase;
use Illuminate\Support\Facades\Event;

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

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

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

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

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

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

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

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

Expand Down
Loading
Loading