diff --git a/composer.json b/composer.json index 970f496..89f81bb 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,7 @@ "require-dev": { "mockery/mockery": "^1.4.4", "orchestra/testbench": "^8.0", - "pestphp/pest": "2.x-dev" + "pestphp/pest": "^2.28" }, "autoload": { "psr-4": { diff --git a/phpunit.xml b/phpunit.xml index 9639a60..023929d 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -8,12 +8,9 @@ processIsolation="false" stopOnFailure="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd" + xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" > - - src/ - @@ -26,4 +23,9 @@ + + + src/ + + diff --git a/tests/Models/PostWithEagerRelation.php b/tests/Models/PostWithEagerRelation.php new file mode 100644 index 0000000..959d3dc --- /dev/null +++ b/tests/Models/PostWithEagerRelation.php @@ -0,0 +1,14 @@ + 'Arthur Conan Doyle' + ]); + $post = new PostWithEagerRelation([ + 'title' => 'My First Post' + ]); + $post->author()->associate($author); + $post->save(); + + self::assertEquals('arthur-conan-doyle-my-first-post', $post->slug); + + $post2 = new PostWithEagerRelation([ + 'title' => 'My second post', + ]); + $post2->author()->associate($author); + $post2->save(); + self::assertEquals('arthur-conan-doyle-my-second-post', $post2->slug); + } + +}