[ticket/10941] Removed the incomplete mark as is_image is fixed

Had to remove one of the tests due to a small limitation with the
functional testing framework. May mark the test as incomplete again
pending further comments.

PHPBB3-10941
This commit is contained in:
Fyorl 2012-07-08 00:46:09 +01:00
parent 682757c1cb
commit a4717ef525

View file

@ -14,13 +14,6 @@ class phpbb_functional_fileupload_test extends phpbb_functional_test_case
{ {
public function test_form_upload() public function test_form_upload()
{ {
// This test is marked as incomplete due to an apparent bug in the
// symfony framework which causes it to lose the mimetype of any file
// uploaded. Since filespec::is_image() relies on the mimetype, all
// image uploads fail. filespec::is_image() is fixed in:
// https://github.com/phpbb/phpbb3/pull/833
$this->markTestIncomplete();
$path = __DIR__ . '/fixtures/files/'; $path = __DIR__ . '/fixtures/files/';
$this->add_lang('posting'); $this->add_lang('posting');
$this->login(); $this->login();
@ -30,21 +23,23 @@ class phpbb_functional_fileupload_test extends phpbb_functional_test_case
$form = $crawler->selectButton('add_file')->form(); $form = $crawler->selectButton('add_file')->form();
$form['fileupload']->upload($path . 'illegal-extension.bif'); $form['fileupload']->upload($path . 'illegal-extension.bif');
$crawler = $this->client->submit($form); $crawler = $this->client->submit($form);
$this->assertEquals(1, $crawler->filter('p.error')->count()); $this->assertEquals('The extension bif is not allowed.', $crawler->filter('p.error')->text());
// Test 2: Empty file // Test 2: Empty file
$crawler = $this->request('GET', 'posting.php?mode=reply&f=2&t=1&sid=' . $this->sid); $crawler = $this->request('GET', 'posting.php?mode=reply&f=2&t=1&sid=' . $this->sid);
$form = $crawler->selectButton('add_file')->form(); $form = $crawler->selectButton('add_file')->form();
$form['fileupload']->upload($path . 'empty.png'); $form['fileupload']->upload($path . 'empty.png');
$crawler = $this->client->submit($form); $crawler = $this->client->submit($form);
$this->assertEquals(1, $crawler->filter('p.error')->count()); $this->assertEquals('The image file you tried to attach is invalid.', $crawler->filter('div#message p')->text());
// Test 3: File too large // Test 3: File too large
$crawler = $this->request('GET', 'posting.php?mode=reply&f=2&t=1&sid=' . $this->sid); // Cannot be tested by an admin account which this functional framework
// provides
/*$crawler = $this->request('GET', 'posting.php?mode=reply&f=2&t=1&sid=' . $this->sid);
$form = $crawler->selectButton('add_file')->form(); $form = $crawler->selectButton('add_file')->form();
$form['fileupload']->upload($path . 'too-large.png'); $form['fileupload']->upload($path . 'too-large.png');
$crawler = $this->client->submit($form); $crawler = $this->client->submit($form);
$this->assertEquals(1, $crawler->filter('div#message')->count()); $this->assertEquals(1, $crawler->filter('div#message')->count());*/
// Test 4: Valid file // Test 4: Valid file
$crawler = $this->request('GET', 'posting.php?mode=reply&f=2&t=1&sid=' . $this->sid); $crawler = $this->request('GET', 'posting.php?mode=reply&f=2&t=1&sid=' . $this->sid);