diff --git a/tests/system/Helpers/FormHelperTest.php b/tests/system/Helpers/FormHelperTest.php index a464fbb488d5..e5666b2b83cf 100644 --- a/tests/system/Helpers/FormHelperTest.php +++ b/tests/system/Helpers/FormHelperTest.php @@ -29,15 +29,18 @@ protected function setUp(): void parent::setUp(); helper('form'); + + $this->resetServices(); } public function testFormOpenBasic() { + $uri = new URI('http://example.com/'); + Services::injectMock('uri', $uri); $config = new App(); $config->baseURL = ''; $config->indexPage = 'index.php'; $request = Services::request($config); - $request->uri = new URI('http://example.com/'); Services::injectMock('request', $request); @@ -67,11 +70,12 @@ public function testFormOpenBasic() public function testFormOpenHasLocale() { + $uri = new URI('http://example.com/'); + Services::injectMock('uri', $uri); $config = new App(); $config->baseURL = ''; $config->indexPage = 'index.php'; $request = Services::request($config); - $request->uri = new URI('http://example.com/'); Services::injectMock('request', $request); $expected = <<<'EOH' @@ -89,11 +93,12 @@ public function testFormOpenHasLocale() public function testFormOpenWithoutAction() { + $uri = new URI('http://example.com/'); + Services::injectMock('uri', $uri); $config = new App(); $config->baseURL = ''; $config->indexPage = 'index.php'; $request = Services::request($config); - $request->uri = new URI('http://example.com/'); Services::injectMock('request', $request); @@ -122,11 +127,12 @@ public function testFormOpenWithoutAction() public function testFormOpenWithoutMethod() { + $uri = new URI('http://example.com/'); + Services::injectMock('uri', $uri); $config = new App(); $config->baseURL = ''; $config->indexPage = 'index.php'; $request = Services::request($config); - $request->uri = new URI('http://example.com/'); Services::injectMock('request', $request); @@ -155,11 +161,12 @@ public function testFormOpenWithoutMethod() public function testFormOpenWithHidden() { + $uri = new URI('http://example.com/'); + Services::injectMock('uri', $uri); $config = new App(); $config->baseURL = ''; $config->indexPage = 'index.php'; $request = Services::request($config); - $request->uri = new URI('http://example.com/'); Services::injectMock('request', $request); @@ -195,11 +202,12 @@ public function testFormOpenWithHidden() public function testFormOpenMultipart() { + $uri = new URI('http://example.com/'); + Services::injectMock('uri', $uri); $config = new App(); $config->baseURL = ''; $config->indexPage = 'index.php'; $request = Services::request($config); - $request->uri = new URI('http://example.com/'); Services::injectMock('request', $request);