File tree Expand file tree Collapse file tree 6 files changed +26
-28
lines changed
Expand file tree Collapse file tree 6 files changed +26
-28
lines changed Original file line number Diff line number Diff line change 99 fail-fast : true
1010 matrix :
1111 os : [ ubuntu-latest ]
12- php : [ 8.0, 8.1 ]
13- laravel : [ 9.* ]
12+ php : [ 8.0, 8.1, 8.2 ]
13+ laravel : [ 9.*, 10.* ]
1414 dependency-version : [ prefer-lowest, prefer-stable ]
15+ exclude :
16+ - laravel : 9.*
17+ php : 8.2
18+ - laravel : 10.*
19+ php : 8.0
1520 include :
1621 - laravel : 9.*
1722 testbench : 7.*
18- legacy-factories : 1.*
23+ - laravel : 10.*
24+ testbench : 8.*
1925
2026 name : P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }}
2127
4248 composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
4349 composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
4450
45- - name : Install legacy factories dependency
46- run : |
47- composer require "laravel/legacy-factories:${{ matrix.legacy-factories }}" --no-interaction
48- if : matrix.legacy-factories
49-
5051 - name : Execute tests
51- run : vendor/bin/phpunit --verbose
52+ run : vendor/bin/phpunit --testdox
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ All notable changes to `laravel-love` will be documented in this file.
66
77### Added
88
9+ - ([ #234 ] ) Added Laravel 10 support
910- ([ #216 ] ) Added Docker Compose to quick development build
1011- ([ #188 ] ) Added ` whereReactedTo ` model scope to Reacterable models
1112- ([ #188 ] ) Added ` whereNotReactedTo ` model scope to Reacterable models
@@ -568,6 +569,7 @@ Follow [upgrade instructions](UPGRADING.md#from-v5-to-v6) to migrate database to
568569[ 1.1.1 ] : https://github.com/cybercog/laravel-love/compare/1.1.0...1.1.1
569570[ 1.1.0 ] : https://github.com/cybercog/laravel-love/compare/1.0.0...1.1.0
570571
572+ [ #234 ] : https://github.com/cybercog/laravel-love/pull/234
571573[ #233 ] : https://github.com/cybercog/laravel-love/pull/233
572574[ #231 ] : https://github.com/cybercog/laravel-love/pull/231
573575[ #222 ] : https://github.com/cybercog/laravel-love/pull/222
Original file line number Diff line number Diff line change 4747 },
4848 "require" : {
4949 "php" : " ^8.0" ,
50- "illuminate/database" : " ^9.0" ,
51- "illuminate/support" : " ^9.0"
50+ "illuminate/database" : " ^9.0|^10.1.3 " ,
51+ "illuminate/support" : " ^9.0|^10.1.3 "
5252 },
5353 "require-dev" : {
54+ "laravel/legacy-factories" : " ^1.3" ,
5455 "mockery/mockery" : " ^1.0" ,
55- "orchestra/database" : " ^7.0" ,
56- "orchestra/testbench" : " ^7.0" ,
56+ "orchestra/testbench" : " ^7.0|^8.0" ,
5757 "phpstan/phpstan" : " ^1.9" ,
58- "phpunit/phpunit" : " ^9.0 "
58+ "phpunit/phpunit" : " ^9.6 "
5959 },
6060 "autoload" : {
6161 "psr-4" : {
Original file line number Diff line number Diff line change 2121use Illuminate \Database \Eloquent \Relations \Relation ;
2222use Illuminate \Filesystem \Filesystem ;
2323use Mockery ;
24- use Orchestra \Database \ConsoleServiceProvider ;
2524use Orchestra \Testbench \TestCase as OrchestraTestCase ;
2625
2726abstract class TestCase extends OrchestraTestCase
@@ -64,7 +63,6 @@ protected function getPackageProviders($app): array
6463 return [
6564 LoveServiceProvider::class,
6665 LoveEventServiceProvider::class,
67- ConsoleServiceProvider::class,
6866 ];
6967 }
7068
Original file line number Diff line number Diff line change 1818use Cog \Laravel \Love \Reaction \Events \ReactionHasBeenAdded ;
1919use Cog \Laravel \Love \ReactionType \Models \ReactionType ;
2020use Cog \Tests \Laravel \Love \TestCase ;
21- use Illuminate \Foundation \ Testing \ Concerns \ MocksApplicationServices ;
21+ use Illuminate \Support \ Facades \ Event ;
2222
2323final class ReactionHasBeenAddedTest extends TestCase
2424{
25- use MocksApplicationServices;
26-
2725 /** @test */
2826 public function it_fires_reaction_has_been_added_event (): void
2927 {
30- $ this ->expectsEvents (ReactionHasBeenAdded::class);
31-
28+ Event::fake ([ReactionHasBeenAdded::class]);
3229 $ reactionType = factory (ReactionType::class)->create ();
3330 $ reacter = factory (Reacter::class)->create ();
3431 $ reactant = factory (Reactant::class)->create ();
3532
3633 $ reacter ->reactTo ($ reactant , $ reactionType );
34+
35+ Event::assertDispatched (ReactionHasBeenAdded::class);
3736 }
3837}
Original file line number Diff line number Diff line change 1111
1212declare (strict_types=1 );
1313
14- namespace Cog \Laravel \Love \ Tests \Unit \Reaction \Events ;
14+ namespace Cog \Tests \ Laravel \Love \Unit \Reaction \Events ;
1515
1616use Cog \Laravel \Love \Reactant \Models \Reactant ;
1717use Cog \Laravel \Love \Reacter \Models \Reacter ;
1818use Cog \Laravel \Love \Reaction \Events \ReactionHasBeenRemoved ;
1919use Cog \Laravel \Love \ReactionType \Models \ReactionType ;
2020use Cog \Tests \Laravel \Love \TestCase ;
21- use Illuminate \Foundation \ Testing \ Concerns \ MocksApplicationServices ;
21+ use Illuminate \Support \ Facades \ Event ;
2222
2323final class ReactionHasBeenRemovedTest extends TestCase
2424{
25- use MocksApplicationServices;
26-
2725 /** @test */
2826 public function it_fire_reaction_has_been_removed_event (): void
2927 {
30- $ this ->expectsEvents (ReactionHasBeenRemoved::class);
31-
28+ Event::fake ([ReactionHasBeenRemoved::class]);
3229 $ reactionType = factory (ReactionType::class)->create ();
3330 $ reacter = factory (Reacter::class)->create ();
3431 $ reactant = factory (Reactant::class)->create ();
35-
3632 $ reacter ->reactTo ($ reactant , $ reactionType );
3733
3834 $ reacter ->unreactTo ($ reactant , $ reactionType );
35+
36+ Event::assertDispatched (ReactionHasBeenRemoved::class);
3937 }
4038}
You can’t perform that action at this time.
0 commit comments