diff --git a/Tests/Listener/VirusScannerListenerTest.php b/Tests/Listener/VirusScannerListenerTest.php index c3db1fe07adfcdf4f1261d0d6fa29291b294a2c9..90319105535bb2ba3611b55c6ab32772b776ffab 100644 --- a/Tests/Listener/VirusScannerListenerTest.php +++ b/Tests/Listener/VirusScannerListenerTest.php @@ -64,8 +64,8 @@ class VirusScannerListenerTest extends PHPUnit_Framework_TestCase 'status' => Client::RESULT_OK ]; - $this->client->expects($this->any())->method('scanFile')->with('foopath')->willReturn($result); - $this->file->expects($this->any())->method('setMetadata')->with(['virus_scanner' => ['has_virus' => false]]); + $this->client->expects($this->once())->method('scanFile')->with('foopath')->willReturn($result); + $this->file->expects($this->once())->method('setMetadata')->with(['virus_scanner' => ['has_virus' => false]]); $this->listener->onFileUploadCompleted($this->event); } @@ -81,12 +81,12 @@ class VirusScannerListenerTest extends PHPUnit_Framework_TestCase 'status' => Client::RESULT_FOUND ]; - $this->client->expects($this->any()) + $this->client->expects($this->once()) ->method('scanFile') ->with('foopath') ->willReturn($result); - $this->file->expects($this->any()) + $this->file->expects($this->once()) ->method('setMetadata') ->with(['virus_scanner' => ['has_virus' => true, 'detected' => 'Terrible virus']]); @@ -98,14 +98,14 @@ class VirusScannerListenerTest extends PHPUnit_Framework_TestCase */ public function testGetClientFailed() { - $this->client->expects($this->any())->method('ping')->willThrowException(new ConnectionException()); + $this->client->expects($this->once())->method('ping')->willThrowException(new ConnectionException()); $this->listener->onFileUploadCompleted($this->event); } public function testGetClientSucceed() { - $this->client->expects($this->any())->method('ping')->willReturn(true); + $this->client->expects($this->once())->method('ping')->willReturn(true); $this->listener->onFileUploadCompleted($this->event); }