@@ -7,7 +7,7 @@ class LineReaderTest extends TestCase
7
7
public function setUp ()
8
8
{
9
9
$ this ->lineReader = new LineReader ();
10
-
10
+
11
11
$ this ->input = new ReadableStream ();
12
12
$ this ->input ->pipe ($ this ->lineReader );
13
13
}
@@ -23,7 +23,7 @@ public function testMethodIsCalled()
23
23
public function testSeperatedData ()
24
24
{
25
25
$ this ->lineReader ->on ('data ' , $ this ->expectCallableOnceWith ('helloworld ' . PHP_EOL ));
26
-
26
+
27
27
$ this ->input ->emit ('data ' , array (
28
28
'hello '
29
29
));
@@ -35,7 +35,7 @@ public function testSeperatedData()
35
35
public function testWithLineBreak ()
36
36
{
37
37
$ this ->lineReader ->on ('data ' , $ this ->expectCallableOnceWith ('hello ' . PHP_EOL ));
38
-
38
+
39
39
$ this ->input ->emit ('data ' , array (
40
40
'hello ' . PHP_EOL . 'world '
41
41
));
@@ -48,7 +48,7 @@ public function testDoubleLineBreak()
48
48
'world ' . PHP_EOL
49
49
);
50
50
$ this ->lineReader ->on ('data ' , $ this ->expectCallableConsecutive (2 , $ expectedValues ));
51
-
51
+
52
52
$ this ->input ->emit ('data ' , array (
53
53
'hello ' . PHP_EOL . 'world ' . PHP_EOL
54
54
));
@@ -69,10 +69,10 @@ public function testResumeStream()
69
69
70
70
public function testPipeStream ()
71
71
{
72
- $ dest = $ this ->getMock ('React\Stream\WritableStreamInterface ' );
73
-
72
+ $ dest = $ this ->getMockBuilder ('React\Stream\WritableStreamInterface ' )-> getMock ( );
73
+
74
74
$ ret = $ this ->lineReader ->pipe ($ dest );
75
-
75
+
76
76
$ this ->assertSame ($ dest , $ ret );
77
77
}
78
78
@@ -92,15 +92,15 @@ public function testIsReadable()
92
92
{
93
93
$ lineReader = new LineReader ();
94
94
$ actual = $ lineReader ->isReadable ();
95
-
95
+
96
96
$ this ->assertTrue ($ actual );
97
97
}
98
98
99
99
public function testIsWritable ()
100
100
{
101
101
$ lineReader = new LineReader ();
102
102
$ actual = $ lineReader ->isWritable ();
103
-
103
+
104
104
$ this ->assertTrue ($ actual );
105
105
}
106
106
@@ -114,13 +114,13 @@ public function testStreamIsAlreadyClosed()
114
114
private function expectCallableConsecutive ($ numberOfCalls , array $ with )
115
115
{
116
116
$ mock = $ this ->createCallableMock ();
117
-
117
+
118
118
for ($ i = 0 ; $ i < $ numberOfCalls ; $ i ++) {
119
119
$ mock ->expects ($ this ->at ($ i ))
120
120
->method ('__invoke ' )
121
121
->with ($ this ->equalTo ($ with [$ i ]));
122
122
}
123
-
123
+
124
124
return $ mock ;
125
125
}
126
126
}
0 commit comments