Skip to content

Commit f09f221

Browse files
committed
test: remove dynamic property
1 parent 85e6421 commit f09f221

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

tests/_support/Filters/Customfilter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class Customfilter implements \CodeIgniter\Filters\FilterInterface
1818
{
1919
public function before(RequestInterface $request, $arguments = null)
2020
{
21-
$request->url = 'http://hellowworld.com';
21+
$request->appendBody('http://hellowworld.com');
2222

2323
return $request;
2424
}

tests/system/CodeIgniterTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ public function testControllersRunFilterByClassName()
200200

201201
// Inject mock router.
202202
$routes = Services::routes();
203-
$routes->add('pages/about', static fn () => Services::request()->url, ['filter' => Customfilter::class]);
203+
$routes->add('pages/about', static fn () => Services::request()->getBody(), ['filter' => Customfilter::class]);
204204

205205
$router = Services::router($routes, Services::request());
206206
Services::injectMock('router', $router);
@@ -210,6 +210,8 @@ public function testControllersRunFilterByClassName()
210210
$output = ob_get_clean();
211211

212212
$this->assertStringContainsString('http://hellowworld.com', $output);
213+
214+
$this->resetServices();
213215
}
214216

215217
public function testResponseConfigEmpty()

0 commit comments

Comments
 (0)