Commit e121ca34 authored by Predhumeau Manon's avatar Predhumeau Manon Committed by Guillaume Perréal
Browse files

CS.

parent 9b4f1673
...@@ -8,9 +8,9 @@ namespace Irstea\FileUploadBundle\Tests\Listener; ...@@ -8,9 +8,9 @@ namespace Irstea\FileUploadBundle\Tests\Listener;
use Irstea\FileUploadBundle\Event\FileUploadCompleteEvent; use Irstea\FileUploadBundle\Event\FileUploadCompleteEvent;
use Irstea\FileUploadBundle\Listener\VirusScannerListener; use Irstea\FileUploadBundle\Listener\VirusScannerListener;
use Irstea\FileUploadBundle\Model\UploadedFileInterface;
use PHPUnit_Framework_MockObject_MockObject; use PHPUnit_Framework_MockObject_MockObject;
use PHPUnit_Framework_TestCase; use PHPUnit_Framework_TestCase;
use Irstea\FileUploadBundle\Model\UploadedFileInterface;
use Xenolope\Quahog\Client; use Xenolope\Quahog\Client;
use Xenolope\Quahog\Exception\ConnectionException; use Xenolope\Quahog\Exception\ConnectionException;
...@@ -55,13 +55,12 @@ class VirusScannerListenerTest extends PHPUnit_Framework_TestCase ...@@ -55,13 +55,12 @@ class VirusScannerListenerTest extends PHPUnit_Framework_TestCase
$this->listener = new VirusScannerListener($this->client); $this->listener = new VirusScannerListener($this->client);
} }
public function testOnFileUploadCompletedResultOk() public function testOnFileUploadCompletedResultOk()
{ {
$result = [ $result = [
'filename' => 'footpath', 'filename' => 'footpath',
'reason' => null, 'reason' => null,
'status' => Client::RESULT_OK 'status' => Client::RESULT_OK,
]; ];
$this->client->expects($this->once())->method('scanFile')->with('foopath')->willReturn($result); $this->client->expects($this->once())->method('scanFile')->with('foopath')->willReturn($result);
...@@ -76,9 +75,9 @@ class VirusScannerListenerTest extends PHPUnit_Framework_TestCase ...@@ -76,9 +75,9 @@ class VirusScannerListenerTest extends PHPUnit_Framework_TestCase
public function testOnFileUploadCompletedVirusFound() public function testOnFileUploadCompletedVirusFound()
{ {
$result = [ $result = [
'filename' => 'footpath', 'filename' => 'foopath',
'reason' => 'Terrible virus', 'reason' => 'Terrible virus',
'status' => Client::RESULT_FOUND 'status' => Client::RESULT_FOUND,
]; ];
$this->client->expects($this->once()) $this->client->expects($this->once())
...@@ -102,7 +101,6 @@ class VirusScannerListenerTest extends PHPUnit_Framework_TestCase ...@@ -102,7 +101,6 @@ class VirusScannerListenerTest extends PHPUnit_Framework_TestCase
$this->listener->onFileUploadCompleted($this->event); $this->listener->onFileUploadCompleted($this->event);
} }
public function testGetClientSucceed() public function testGetClientSucceed()
{ {
$this->client->expects($this->once())->method('ping')->willReturn(true); $this->client->expects($this->once())->method('ping')->willReturn(true);
......
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