3
3
namespace Illuminate \Tests \Database ;
4
4
5
5
use Illuminate \Console \OutputStyle ;
6
+ use Illuminate \Console \View \Components \Factory ;
6
7
use Illuminate \Container \Container ;
7
8
use Illuminate \Contracts \Events \Dispatcher ;
8
9
use Illuminate \Database \ConnectionResolverInterface ;
@@ -23,6 +24,7 @@ public function testHandle()
23
24
{
24
25
$ input = new ArrayInput (['--force ' => true , '--database ' => 'sqlite ' ]);
25
26
$ output = new NullOutput ;
27
+ $ outputStyle = new OutputStyle ($ input , $ output );
26
28
27
29
$ seeder = m::mock (Seeder::class);
28
30
$ seeder ->shouldReceive ('setContainer ' )->once ()->andReturnSelf ();
@@ -38,7 +40,10 @@ public function testHandle()
38
40
$ container ->shouldReceive ('environment ' )->once ()->andReturn ('testing ' );
39
41
$ container ->shouldReceive ('make ' )->with ('DatabaseSeeder ' )->andReturn ($ seeder );
40
42
$ container ->shouldReceive ('make ' )->with (OutputStyle::class, m::any ())->andReturn (
41
- new OutputStyle ($ input , $ output )
43
+ $ outputStyle
44
+ );
45
+ $ container ->shouldReceive ('make ' )->with (Factory::class, m::any ())->andReturn (
46
+ new Factory ($ outputStyle )
42
47
);
43
48
44
49
$ command = new SeedCommand ($ resolver );
@@ -59,6 +64,7 @@ public function testWithoutModelEvents()
59
64
'--class ' => UserWithoutModelEventsSeeder::class,
60
65
]);
61
66
$ output = new NullOutput ;
67
+ $ outputStyle = new OutputStyle ($ input , $ output );
62
68
63
69
$ instance = new UserWithoutModelEventsSeeder ();
64
70
@@ -75,7 +81,10 @@ public function testWithoutModelEvents()
75
81
$ container ->shouldReceive ('environment ' )->once ()->andReturn ('testing ' );
76
82
$ container ->shouldReceive ('make ' )->with (UserWithoutModelEventsSeeder::class)->andReturn ($ seeder );
77
83
$ container ->shouldReceive ('make ' )->with (OutputStyle::class, m::any ())->andReturn (
78
- new OutputStyle ($ input , $ output )
84
+ $ outputStyle
85
+ );
86
+ $ container ->shouldReceive ('make ' )->with (Factory::class, m::any ())->andReturn (
87
+ new Factory ($ outputStyle )
79
88
);
80
89
81
90
$ command = new SeedCommand ($ resolver );
0 commit comments