1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-06 00:37:42 +02:00

[ticket/develop/11568] Do not directly access $client from tests

PHPBB3-11568
This commit is contained in:
Joas Schilling
2013-05-28 14:55:04 +02:00
parent 6d9888be65
commit 467c4d62c4
6 changed files with 13 additions and 17 deletions

View File

@@ -115,8 +115,9 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c
public function test_missing_argument()
{
$this->phpbb_extension_manager->enable('foo/bar');
$crawler = $this->request('GET', 'app.php?controller=foo/baz');
$this->assertEquals(500, $this->client->getResponse()->getStatus());
$crawler = $this->request('GET', 'app.php?controller=foo/baz', false);
$this->request('GET', 'app.php?controller=foo/baz', false);
$this->assert_response_success(500);
$this->assertContains('Missing value for argument #1: test in class phpbb_ext_foo_bar_controller:baz', $crawler->filter('body')->text());
$this->phpbb_extension_manager->purge('foo/bar');
}
@@ -128,7 +129,7 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c
{
$this->phpbb_extension_manager->enable('foo/bar');
$crawler = $this->request('GET', 'app.php?controller=foo/exception');
$this->assertEquals(500, $this->client->getResponse()->getStatus());
$this->assert_response_success(500);
$this->assertContains('Exception thrown from foo/exception route', $crawler->filter('body')->text());
$this->phpbb_extension_manager->purge('foo/bar');
}
@@ -145,7 +146,7 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c
public function test_error_ext_disabled_or_404()
{
$crawler = $this->request('GET', 'app.php?controller=does/not/exist');
$this->assertEquals(404, $this->client->getResponse()->getStatus());
$this->assert_response_success(404);
$this->assertContains('No route found for "GET /does/not/exist"', $crawler->filter('body')->text());
}
}