Skip to content

Commit

Permalink
tests: fix compatibility with latest nette
Browse files Browse the repository at this point in the history
  • Loading branch information
xificurk committed Jan 15, 2021
1 parent 876cbfb commit 104304a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/FormRenderer/Bootstrap3RendererTest.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class Bootstrap3RendererTest extends TestCase
$this->templateRendererFactory = new TestTemplateRendererFactory();
$this->testFormFactory = new TestFormFactory();

$_SERVER['REQUEST_METHOD'] = 'GET';
$this->resetHttpGlobalVariables();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/FormRenderer/Bootstrap4RendererTest.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class Bootstrap4RendererTest extends TestCase
$this->templateRendererFactory = new TestTemplateRendererFactory();
$this->testFormFactory = new TestFormFactory();

$_SERVER['REQUEST_METHOD'] = 'GET';
$this->resetHttpGlobalVariables();
}

/**
Expand Down
9 changes: 9 additions & 0 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,13 @@ protected function tearDown(): void
Mockery::close();
}

protected function resetHttpGlobalVariables(): void
{
$_SERVER['REQUEST_METHOD'] = 'GET';
$_FILES = [];
$_COOKIE['_nss'] = '1';
$_POST = [];
$_GET = [];
}

}

0 comments on commit 104304a

Please sign in to comment.