From 7b7e674ef0ea4e0383466b6b1b0f2b3d47627c3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillaume=20Perr=C3=A9al?= <guillaume.perreal@irstea.fr> Date: Wed, 9 Dec 2015 12:45:29 +0100 Subject: [PATCH] Correction des TU. --- Tests/Listener/UploadedFileListenerTest.php | 12 +++++++++--- composer.json | 2 +- nbproject/project.properties | 12 ++++++------ 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/Tests/Listener/UploadedFileListenerTest.php b/Tests/Listener/UploadedFileListenerTest.php index 26856805..cbf43098 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 90cebdd3..6210326f 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 e5b6016b..9ff1e39c 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 -- GitLab