@@ -22,11 +22,11 @@ class AddPathPluginTest extends TestCase
22
22
/**
23
23
* @var callable empty
24
24
*/
25
- private $ callable ;
25
+ private $ first ;
26
26
27
27
protected function setUp ()
28
28
{
29
- $ this ->callable = function () {};
29
+ $ this ->first = function () {};
30
30
$ this ->plugin = new AddPathPlugin (new Uri ('/api ' ));
31
31
}
32
32
@@ -37,14 +37,14 @@ public function testRewriteSameUrl()
37
37
};
38
38
39
39
$ request = new Request ('GET ' , 'https://example.com/foo ' , ['Content-Type ' =>'text/html ' ]);
40
- $ this ->plugin ->handleRequest ($ request , $ verify , $ this ->callable );
40
+ $ this ->plugin ->handleRequest ($ request , $ verify , $ this ->first );
41
41
42
42
// Make a second call with the same $request object
43
- $ this ->plugin ->handleRequest ($ request , $ verify , $ this ->callable );
43
+ $ this ->plugin ->handleRequest ($ request , $ verify , $ this ->first );
44
44
45
45
// Make a new call with a new object but same URL
46
46
$ request = new Request ('GET ' , 'https://example.com/foo ' , ['Content-Type ' =>'text/plain ' ]);
47
- $ this ->plugin ->handleRequest ($ request , $ verify , $ this ->callable );
47
+ $ this ->plugin ->handleRequest ($ request , $ verify , $ this ->first );
48
48
}
49
49
50
50
public function testRewriteCallingThePluginTwice ()
@@ -56,21 +56,21 @@ public function testRewriteCallingThePluginTwice()
56
56
// Run the plugin again with the modified request
57
57
$ this ->plugin ->handleRequest ($ request , function (RequestInterface $ request ) {
58
58
$ this ->assertEquals ('https://example.com/api/foo ' , $ request ->getUri ()->__toString ());
59
- }, $ this ->callable );
60
- }, $ this ->callable );
59
+ }, $ this ->first );
60
+ }, $ this ->first );
61
61
}
62
62
63
63
public function testRewriteWithDifferentUrl ()
64
64
{
65
65
$ request = new Request ('GET ' , 'https://example.com/foo ' );
66
66
$ this ->plugin ->handleRequest ($ request , function (RequestInterface $ request ) {
67
67
$ this ->assertEquals ('https://example.com/api/foo ' , $ request ->getUri ()->__toString ());
68
- }, $ this ->callable );
68
+ }, $ this ->first );
69
69
70
70
$ request = new Request ('GET ' , 'https://example.com/bar ' );
71
71
$ this ->plugin ->handleRequest ($ request , function (RequestInterface $ request ) {
72
72
$ this ->assertEquals ('https://example.com/api/bar ' , $ request ->getUri ()->__toString ());
73
- }, $ this ->callable );
73
+ }, $ this ->first );
74
74
}
75
75
76
76
public function testRewriteWithDifferentUrlWhenSecondUrlIncludesAddedPath ()
@@ -80,10 +80,10 @@ public function testRewriteWithDifferentUrlWhenSecondUrlIncludesAddedPath()
80
80
};
81
81
82
82
$ request = new Request ('GET ' , 'https://example.com/foo ' );
83
- $ this ->plugin ->handleRequest ($ request , $ verify , $ this ->callable );
83
+ $ this ->plugin ->handleRequest ($ request , $ verify , $ this ->first );
84
84
85
85
$ request = new Request ('GET ' , 'https://example.com/api/foo ' );
86
- $ this ->plugin ->handleRequest ($ request , $ verify , $ this ->callable );
86
+ $ this ->plugin ->handleRequest ($ request , $ verify , $ this ->first );
87
87
}
88
88
89
89
public function testRewriteWhenPathIsIncluded ()
@@ -93,7 +93,7 @@ public function testRewriteWhenPathIsIncluded()
93
93
};
94
94
95
95
$ request = new Request ('GET ' , 'https://example.com/api/foo ' );
96
- $ this ->plugin ->handleRequest ($ request , $ verify , $ this ->callable );
96
+ $ this ->plugin ->handleRequest ($ request , $ verify , $ this ->first );
97
97
}
98
98
public function testRewriteOnRestart ()
99
99
{
0 commit comments