@@ -16,7 +16,6 @@ protected function setUp()
1616 parent ::setUp ();
1717
1818 $ this ->skipEvents ();
19- $ this ->clean = false ;
2019 }
2120
2221 public function testCallGet ()
@@ -43,7 +42,7 @@ public function testCallSimpleGet()
4342 'add ' ,
4443 'home ' ,
4544 function () {
46- return 'Hello World ' ;
45+ return 'Hello Earth ' ;
4746 },
4847 ],
4948 ]);
@@ -52,7 +51,7 @@ function () {
5251 $ this ->assertInstanceOf (FeatureResponse::class, $ response );
5352 $ this ->assertInstanceOf (\CodeIgniter \HTTP \Response::class, $ response ->response );
5453 $ this ->assertTrue ($ response ->isOK ());
55- $ this ->assertEquals ('Hello World ' , $ response ->response ->getBody ());
54+ $ this ->assertEquals ('Hello Earth ' , $ response ->response ->getBody ());
5655 $ this ->assertEquals (200 , $ response ->response ->getStatusCode ());
5756 }
5857
@@ -63,13 +62,13 @@ public function testCallPost()
6362 'post ' ,
6463 'home ' ,
6564 function () {
66- return 'Hello World ' ;
65+ return 'Hello Mars ' ;
6766 },
6867 ],
6968 ]);
7069 $ response = $ this ->post ('home ' );
7170
72- $ response ->assertSee ('Hello World ' );
71+ $ response ->assertSee ('Hello Mars ' );
7372 }
7473
7574 public function testCallPut ()
@@ -79,13 +78,13 @@ public function testCallPut()
7978 'put ' ,
8079 'home ' ,
8180 function () {
82- return 'Hello World ' ;
81+ return 'Hello Pluto ' ;
8382 },
8483 ],
8584 ]);
8685 $ response = $ this ->put ('home ' );
8786
88- $ response ->assertSee ('Hello World ' );
87+ $ response ->assertSee ('Hello Pluto ' );
8988 }
9089
9190 public function testCallPatch ()
@@ -95,13 +94,13 @@ public function testCallPatch()
9594 'patch ' ,
9695 'home ' ,
9796 function () {
98- return 'Hello World ' ;
97+ return 'Hello Jupiter ' ;
9998 },
10099 ],
101100 ]);
102101 $ response = $ this ->patch ('home ' );
103102
104- $ response ->assertSee ('Hello World ' );
103+ $ response ->assertSee ('Hello Jupiter ' );
105104 }
106105
107106 public function testCallOptions ()
@@ -111,13 +110,13 @@ public function testCallOptions()
111110 'options ' ,
112111 'home ' ,
113112 function () {
114- return 'Hello World ' ;
113+ return 'Hello George ' ;
115114 },
116115 ],
117116 ]);
118117 $ response = $ this ->options ('home ' );
119118
120- $ response ->assertSee ('Hello World ' );
119+ $ response ->assertSee ('Hello George ' );
121120 }
122121
123122 public function testCallDelete ()
@@ -127,13 +126,13 @@ public function testCallDelete()
127126 'delete ' ,
128127 'home ' ,
129128 function () {
130- return 'Hello World ' ;
129+ return 'Hello Wonka ' ;
131130 },
132131 ],
133132 ]);
134133 $ response = $ this ->delete ('home ' );
135134
136- $ response ->assertSee ('Hello World ' );
135+ $ response ->assertSee ('Hello Wonka ' );
137136 }
138137
139138 public function testSession ()
@@ -147,4 +146,43 @@ public function testSession()
147146 $ response ->assertSessionMissing ('popcorn ' );
148147 }
149148
149+ public function testReturns ()
150+ {
151+ $ this ->withRoutes ([
152+ [
153+ 'get ' ,
154+ 'home ' ,
155+ 'Tests\Support\Controllers\Popcorn::index ' ,
156+ ],
157+ ]);
158+ $ response = $ this ->get ('home ' );
159+ $ response ->assertSee ('Hi ' );
160+ }
161+
162+ public function testIgnores ()
163+ {
164+ $ this ->withRoutes ([
165+ [
166+ 'get ' ,
167+ 'home ' ,
168+ 'Tests\Support\Controllers\Popcorn::cat ' ,
169+ ],
170+ ]);
171+ $ response = $ this ->get ('home ' );
172+ $ response ->assertEmpty ($ response ->response ->getBody ());
173+ }
174+
175+ public function testEchoes ()
176+ {
177+ $ this ->withRoutes ([
178+ [
179+ 'get ' ,
180+ 'home ' ,
181+ 'Tests\Support\Controllers\Popcorn::canyon ' ,
182+ ],
183+ ]);
184+ $ response = $ this ->get ('home ' );
185+ $ response ->assertSee ('Hello-o-o ' );
186+ }
187+
150188}
0 commit comments