diff --git a/Tests/Listener/UploadedFileListenerTest.php b/Tests/Listener/UploadedFileListenerTest.php index 26856805a778f56ac60595886f160639314af01d..cbf43098889f4960b55646f35689bb0a88de252f 100644 --- a/Tests/Listener/UploadedFileListenerTest.php +++ b/Tests/Listener/UploadedFileListenerTest.php @@ -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); } } diff --git a/composer.json b/composer.json index 90cebdd3c872b7ca45a6eab32d1f371dff3dae38..6210326f909c3f5a48f65ab69ce162d75fe249c0 100644 --- a/composer.json +++ b/composer.json @@ -37,7 +37,7 @@ }, "require-dev": { "sensio/generator-bundle": "~2.3", - "phpunit/phpunit": "~4.5", + "phpunit/phpunit": "~4.5,<4.8", "phpmd/phpmd": "~2.2", "squizlabs/php_codesniffer": "~2.3", "cleentfaar/tissue": "dev-master", diff --git a/nbproject/project.properties b/nbproject/project.properties index e5b6016b6986bfd000a71bfd4ab9b3a1703b7cfb..9ff1e39cfccfcb7e4793c284a76fab1234332677 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -1,12 +1,12 @@ 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