Commit 7b7e674e authored by Guillaume Perréal's avatar Guillaume Perréal
Browse files

Correction des TU.

parent 0011c57e
......@@ -112,24 +112,28 @@ class UploadedFileListenerTest extends PHPUnit_Framework_TestCase
/**
* @covers Irstea\FileUploadBundle\Listener\UploadedFileListener::postRemove
*/
public function testPostRemove()
public function testRemove()
{
$this->file->expects($this->any())->method('getId')->willReturn('bla');
$this->file->expects($this->once())->method('getPath')->willReturn('foobar');
$this->filesystem->expects($this->once())->method('delete')->with('foobar');
$this->listener->preRemove($this->file, $this->event);
$this->listener->postRemove($this->file, $this->event);
}
/**
* @covers Irstea\FileUploadBundle\Listener\UploadedFileListener::postRemove
*/
public function testPostRemoveIgnoreFileNotFound()
public function testRemoveIgnoreFileNotFound()
{
$this->file->expects($this->any())->method('getId')->willReturn('bla');
$this->file->expects($this->once())->method('getPath')->willReturn('foobar');
$this->filesystem->expects($this->once())->method('delete')->with('foobar')->willThrowException(new FileNotFound('foobar'));
$this->listener->preRemove($this->file, $this->event);
$this->listener->postRemove($this->file, $this->event);
}
......@@ -137,12 +141,14 @@ class UploadedFileListenerTest extends PHPUnit_Framework_TestCase
* @covers Irstea\FileUploadBundle\Listener\UploadedFileListener::postRemove
* @expectedException \InvalidArgumentException
*/
public function testPostRemovePropagateOtherExceptions()
public function testRemovePropagateOtherExceptions()
{
$this->file->expects($this->any())->method('getId')->willReturn('bla');
$this->file->expects($this->once())->method('getPath')->willReturn('foobar');
$this->filesystem->expects($this->once())->method('delete')->with('foobar')->willThrowException(new \InvalidArgumentException());
$this->listener->preRemove($this->file, $this->event);
$this->listener->postRemove($this->file, $this->event);
}
}
auxiliary.org-netbeans-modules-php-phpunit.bootstrap_2e_create_2e_tests=false
auxiliary.org-netbeans-modules-php-phpunit.bootstrap_2e_enabled=false
auxiliary.org-netbeans-modules-php-phpunit.bootstrap_2e_path=
auxiliary.org-netbeans-modules-php-phpunit.configuration_2e_enabled=false
auxiliary.org-netbeans-modules-php-phpunit.configuration_2e_path=
auxiliary.org-netbeans-modules-php-phpunit.bootstrap_2e_enabled=true
auxiliary.org-netbeans-modules-php-phpunit.bootstrap_2e_path=vendor/autoload.php
auxiliary.org-netbeans-modules-php-phpunit.configuration_2e_enabled=true
auxiliary.org-netbeans-modules-php-phpunit.configuration_2e_path=phpunit.xml.dist
auxiliary.org-netbeans-modules-php-phpunit.customSuite_2e_enabled=false
auxiliary.org-netbeans-modules-php-phpunit.customSuite_2e_path=
auxiliary.org-netbeans-modules-php-phpunit.phpUnit_2e_enabled=false
auxiliary.org-netbeans-modules-php-phpunit.phpUnit_2e_path=
auxiliary.org-netbeans-modules-php-phpunit.phpUnit_2e_enabled=true
auxiliary.org-netbeans-modules-php-phpunit.phpUnit_2e_path=vendor/bin/phpunit
auxiliary.org-netbeans-modules-php-phpunit.test_2e_groups_2e_ask=false
auxiliary.org-netbeans-modules-php-phpunit.test_2e_run_2e_all=false
auxiliary.org-netbeans-modules-web-clientproject-api.js_2e_libs_2e_folder=Resources/js/widget
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment