3
3
use Clue \React \ViewVcApi \Client ;
4
4
use Clue \React \Buzz \Message \Response ;
5
5
use Clue \React \Buzz \Message \Body ;
6
+ use React \Promise ;
6
7
7
8
class ClientTest extends TestCase
8
9
{
@@ -32,7 +33,7 @@ public function testInvalidFile()
32
33
public function testFetchFile ()
33
34
{
34
35
$ response = new Response ('HTTP/1.0 ' , 200 , 'OK ' , array (), new Body ('# hello ' ));
35
- $ this ->browser ->expects ($ this ->once ())->method ('get ' )->with ($ this ->equalTo ('http://viewvc.example.org/README.md?view=co ' ))->will ($ this ->returnValue ($ this -> createPromiseResolved ($ response )));
36
+ $ this ->browser ->expects ($ this ->once ())->method ('get ' )->with ($ this ->equalTo ('http://viewvc.example.org/README.md?view=co ' ))->will ($ this ->returnValue (Promise \resolve ($ response )));
36
37
37
38
$ promise = $ this ->client ->fetchFile ('README.md ' );
38
39
@@ -41,7 +42,7 @@ public function testFetchFile()
41
42
42
43
public function testFetchFileExcessiveSlashesAreIgnored ()
43
44
{
44
- $ this ->browser ->expects ($ this ->once ())->method ('get ' )->with ($ this ->equalTo ('http://viewvc.example.org/README.md?view=co ' ))->will ($ this ->returnValue ($ this -> createPromiseRejected ()));
45
+ $ this ->browser ->expects ($ this ->once ())->method ('get ' )->with ($ this ->equalTo ('http://viewvc.example.org/README.md?view=co ' ))->will ($ this ->returnValue (Promise \reject ()));
45
46
46
47
$ client = new Client ($ this ->url . '/ ' , $ this ->browser );
47
48
$ promise = $ client ->fetchFile ('/README.md ' );
@@ -51,7 +52,7 @@ public function testFetchFileExcessiveSlashesAreIgnored()
51
52
52
53
public function testFetchFileRevision ()
53
54
{
54
- $ this ->browser ->expects ($ this ->once ())->method ('get ' )->with ($ this ->equalTo ('http://viewvc.example.org/README.md?view=co&pathrev=1.0 ' ))->will ($ this ->returnValue ($ this -> createPromiseRejected ()));
55
+ $ this ->browser ->expects ($ this ->once ())->method ('get ' )->with ($ this ->equalTo ('http://viewvc.example.org/README.md?view=co&pathrev=1.0 ' ))->will ($ this ->returnValue (Promise \reject ()));
55
56
56
57
$ promise = $ this ->client ->fetchFile ('/README.md ' , '1.0 ' );
57
58
@@ -60,7 +61,7 @@ public function testFetchFileRevision()
60
61
61
62
public function testFetchDirectoryRevision ()
62
63
{
63
- $ this ->browser ->expects ($ this ->once ())->method ('get ' )->with ($ this ->equalTo ('http://viewvc.example.org/directory/?pathrev=1.0 ' ))->will ($ this ->returnValue ($ this -> createPromiseRejected ()));
64
+ $ this ->browser ->expects ($ this ->once ())->method ('get ' )->with ($ this ->equalTo ('http://viewvc.example.org/directory/?pathrev=1.0 ' ))->will ($ this ->returnValue (Promise \reject ()));
64
65
65
66
$ promise = $ this ->client ->fetchDirectory ('/directory/ ' , '1.0 ' );
66
67
@@ -69,7 +70,7 @@ public function testFetchDirectoryRevision()
69
70
70
71
public function testFetchDirectoryAttic ()
71
72
{
72
- $ this ->browser ->expects ($ this ->once ())->method ('get ' )->with ($ this ->equalTo ('http://viewvc.example.org/directory/?hideattic=0 ' ))->will ($ this ->returnValue ($ this -> createPromiseRejected ()));
73
+ $ this ->browser ->expects ($ this ->once ())->method ('get ' )->with ($ this ->equalTo ('http://viewvc.example.org/directory/?hideattic=0 ' ))->will ($ this ->returnValue (Promise \reject ()));
73
74
74
75
$ promise = $ this ->client ->fetchDirectory ('/directory/ ' , null , true );
75
76
@@ -78,7 +79,7 @@ public function testFetchDirectoryAttic()
78
79
79
80
public function testFetchDirectoryRevisionAttic ()
80
81
{
81
- $ this ->browser ->expects ($ this ->once ())->method ('get ' )->with ($ this ->equalTo ('http://viewvc.example.org/directory/?pathrev=1.1&hideattic=0 ' ))->will ($ this ->returnValue ($ this -> createPromiseRejected ()));
82
+ $ this ->browser ->expects ($ this ->once ())->method ('get ' )->with ($ this ->equalTo ('http://viewvc.example.org/directory/?pathrev=1.1&hideattic=0 ' ))->will ($ this ->returnValue (Promise \reject ()));
82
83
83
84
$ promise = $ this ->client ->fetchDirectory ('/directory/ ' , '1.1 ' , true );
84
85
@@ -87,7 +88,7 @@ public function testFetchDirectoryRevisionAttic()
87
88
88
89
public function testFetchLogRevision ()
89
90
{
90
- $ this ->browser ->expects ($ this ->once ())->method ('get ' )->with ($ this ->equalTo ('http://viewvc.example.org/README.md?view=log&pathrev=1.0 ' ))->will ($ this ->returnValue ($ this -> createPromiseRejected ()));
91
+ $ this ->browser ->expects ($ this ->once ())->method ('get ' )->with ($ this ->equalTo ('http://viewvc.example.org/README.md?view=log&pathrev=1.0 ' ))->will ($ this ->returnValue (Promise \reject ()));
91
92
92
93
$ promise = $ this ->client ->fetchLog ('/README.md ' , '1.0 ' );
93
94
@@ -96,7 +97,7 @@ public function testFetchLogRevision()
96
97
97
98
public function testFetchPatch ()
98
99
{
99
- $ this ->browser ->expects ($ this ->once ())->method ('get ' )->with ($ this ->equalTo ('http://viewvc.example.org/README.md?view=patch&r1=1.0&r2=1.1 ' ))->will ($ this ->returnValue ($ this -> createPromiseRejected ()));
100
+ $ this ->browser ->expects ($ this ->once ())->method ('get ' )->with ($ this ->equalTo ('http://viewvc.example.org/README.md?view=patch&r1=1.0&r2=1.1 ' ))->will ($ this ->returnValue (Promise \reject ()));
100
101
101
102
$ promise = $ this ->client ->fetchPatch ('/README.md ' , '1.0 ' , '1.1 ' );
102
103
0 commit comments