6
6
use League \CLImate \Util \Output ;
7
7
use League \CLImate \Util \Reader \Stdin ;
8
8
use League \CLImate \Util \System \Linux ;
9
+ use League \CLImate \Util \UtilFactory ;
9
10
use Mockery ;
10
11
use PHPUnit \Framework \TestCase ;
11
12
12
- class TestBase extends TestCase
13
+ abstract class TestBase extends TestCase
13
14
{
14
15
public static $ functions ;
15
16
16
- /** @var League\CLImate\ CLImate */
17
+ /** @var CLImate */
17
18
public $ cli ;
18
19
19
- /** @var League\CLImate\Util\ Output|Mockery\MockInterface */
20
+ /** @var Output|Mockery\MockInterface */
20
21
public $ output ;
21
22
22
- /** @var League\CLImate\Util\Reader\ Stdin|Mockery\MockInterface */
23
+ /** @var Stdin|Mockery\MockInterface */
23
24
public $ reader ;
24
25
25
- /** @var League\CLImate\Util\ UtilFactory */
26
+ /** @var UtilFactory */
26
27
public $ util ;
27
28
28
- protected $ record_it = false ;
29
29
30
30
public function setUp (): void
31
31
{
@@ -35,17 +35,13 @@ public function setUp(): void
35
35
$ system ->shouldReceive ('hasAnsiSupport ' )->andReturn (true );
36
36
$ system ->shouldReceive ('width ' )->andReturn (80 );
37
37
38
- $ this ->util = new \ League \ CLImate \ Util \ UtilFactory ($ system );
38
+ $ this ->util = new UtilFactory ($ system );
39
39
$ this ->output = Mockery::mock (Output::class);
40
40
$ this ->reader = Mockery::mock (Stdin::class);
41
41
42
42
$ this ->cli = new CLImate ();
43
43
$ this ->cli ->setOutput ($ this ->output );
44
44
$ this ->cli ->setUtil ($ this ->util );
45
-
46
- if (method_exists ($ this , 'internalSetup ' )) {
47
- $ this ->internalSetup ();
48
- }
49
45
}
50
46
51
47
public function tearDown (): void
@@ -61,10 +57,6 @@ public function tearDown(): void
61
57
*/
62
58
protected function shouldWrite ($ content , $ count = 1 )
63
59
{
64
- if ($ this ->record_it ) {
65
- file_put_contents ('test-log ' , $ content , FILE_APPEND );
66
- }
67
-
68
60
return $ this ->output ->shouldReceive ('write ' )->times ($ count )->with ($ content );
69
61
}
70
62
@@ -121,13 +113,4 @@ protected function shouldStopPersisting($times = 1)
121
113
{
122
114
$ this ->output ->shouldReceive ('persist ' )->with (false )->times ($ times )->andReturn ($ this ->output );
123
115
}
124
-
125
- /**
126
- * @test
127
- * @doesNotPerformAssertions
128
- */
129
- public function it_does_nothing ()
130
- {
131
- // nada
132
- }
133
116
}
0 commit comments