33namespace Staudenmeir \LaravelAdjacencyList \Tests \IdeHelper ;
44
55use Barryvdh \LaravelIdeHelper \Console \ModelsCommand ;
6+ use Illuminate \Contracts \Config \Repository ;
7+ use Illuminate \Contracts \Foundation \Application ;
68use Mockery ;
79use Mockery \Adapter \Phpunit \MockeryPHPUnitIntegration ;
810use PHPUnit \Framework \TestCase ;
@@ -16,11 +18,14 @@ class RecursiveRelationsHookTest extends TestCase
1618
1719 public function testTreeRelations (): void
1820 {
19- $ config = Mockery::mock ();
21+ $ config = Mockery::mock (Repository::class );
2022 $ config ->shouldReceive ('get ' )->andReturn (true );
2123
24+ $ app = Mockery::mock (Application::class);
25+ $ app ->shouldReceive ('make ' )->andReturn ($ config );
26+
2227 $ command = Mockery::mock (ModelsCommand::class);
23- $ command ->shouldReceive ('getLaravel ' )->andReturn ([ ' config ' => $ config ] );
28+ $ command ->shouldReceive ('getLaravel ' )->andReturn ($ app );
2429 $ command ->shouldReceive ('setProperty ' )->times (2 );
2530 $ command ->shouldReceive ('setProperty ' )->once ()->with (
2631 'ancestorsAndSelf ' ,
@@ -55,11 +60,14 @@ public function testTreeRelations(): void
5560
5661 public function testGraphRelations (): void
5762 {
58- $ config = Mockery::mock ();
63+ $ config = Mockery::mock (Repository::class );
5964 $ config ->shouldReceive ('get ' )->andReturn (true );
6065
66+ $ app = Mockery::mock (Application::class);
67+ $ app ->shouldReceive ('make ' )->andReturn ($ config );
68+
6169 $ command = Mockery::mock (ModelsCommand::class);
62- $ command ->shouldReceive ('getLaravel ' )->andReturn ([ ' config ' => $ config ] );
70+ $ command ->shouldReceive ('getLaravel ' )->andReturn ($ app );
6371 $ command ->shouldReceive ('setProperty ' )->times (2 );
6472 $ command ->shouldReceive ('setProperty ' )->once ()->with (
6573 'ancestorsAndSelf ' ,
0 commit comments