Skip to content

Commit

Permalink
test: remove $request->uri
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjis committed Oct 3, 2022
1 parent d8b5045 commit c08fa41
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions tests/system/Helpers/FormHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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'
Expand All @@ -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);

Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit c08fa41

Please sign in to comment.