mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-03 15:27:42 +02:00
[ticket/10758-upload] Convert error to a failure.
PHPBB3-10758
This commit is contained in:
@@ -45,7 +45,7 @@ class phpbb_functional_fileupload_form_test extends phpbb_functional_test_case
|
||||
public function test_empty_file()
|
||||
{
|
||||
$crawler = $this->upload_file('empty.png', 'image/png');
|
||||
$this->assertEquals($this->lang('ATTACHED_IMAGE_NOT_IMAGE'), $crawler->filter('div#message p')->text());
|
||||
$this->assertEquals($this->lang('ATTACHED_IMAGE_NOT_IMAGE'), $this->assert_filter($crawler, 'div#message p')->text());
|
||||
}
|
||||
|
||||
public function test_invalid_extension()
|
||||
|
@@ -424,4 +424,20 @@ class phpbb_functional_test_case extends phpbb_test_case
|
||||
$content = $this->client->getResponse()->getContent();
|
||||
$this->assertNotContains('Fatal error:', $content);
|
||||
}
|
||||
|
||||
public function assert_filter($crawler, $expr, $msg = null)
|
||||
{
|
||||
$nodes = $crawler->filter($expr);
|
||||
if ($msg)
|
||||
{
|
||||
$msg .= "\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$msg = '';
|
||||
}
|
||||
$msg .= "`$expr` not found in DOM.";
|
||||
$this->assertGreaterThan(0, count($nodes), $msg);
|
||||
return $nodes;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user