Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pôle IS
Bundles Symfony 2
file-upload-bundle
Commits
cd985e6a
Commit
cd985e6a
authored
Oct 20, 2017
by
Predhumeau Manon
Committed by
Guillaume Perréal
Jul 24, 2018
Browse files
CS.
parent
e121ca34
Changes
2
Hide whitespace changes
Inline
Side-by-side
Listener/VirusScannerListener.php
View file @
cd985e6a
...
@@ -6,9 +6,9 @@
...
@@ -6,9 +6,9 @@
namespace
Irstea\FileUploadBundle\Listener
;
namespace
Irstea\FileUploadBundle\Listener
;
use
Xenolope\Quahog\Client
;
use
Irstea\FileUploadBundle\Event\FileUploadCompleteEvent
;
use
Irstea\FileUploadBundle\Event\FileUploadCompleteEvent
;
use
Irstea\FileUploadBundle\Exception\RejectedFileException
;
use
Irstea\FileUploadBundle\Exception\RejectedFileException
;
use
Xenolope\Quahog\Client
;
use
Xenolope\Quahog\Exception\ConnectionException
;
use
Xenolope\Quahog\Exception\ConnectionException
;
/**
/**
...
@@ -21,7 +21,6 @@ class VirusScannerListener
...
@@ -21,7 +21,6 @@ class VirusScannerListener
*/
*/
private
$client
;
private
$client
;
/**
/**
* @param Client $client
* @param Client $client
*/
*/
...
@@ -30,9 +29,9 @@ class VirusScannerListener
...
@@ -30,9 +29,9 @@ class VirusScannerListener
$this
->
client
=
$client
;
$this
->
client
=
$client
;
}
}
/**
/**
* @param FileUploadCompleteEvent $event
* @param FileUploadCompleteEvent $event
*
* @throws ConnectionException
* @throws ConnectionException
*/
*/
public
function
onFileUploadCompleted
(
FileUploadCompleteEvent
$event
)
public
function
onFileUploadCompleted
(
FileUploadCompleteEvent
$event
)
...
@@ -61,13 +60,15 @@ class VirusScannerListener
...
@@ -61,13 +60,15 @@ class VirusScannerListener
}
}
/**
/**
* @return Client
* @throws ConnectionException
* @throws ConnectionException
*
* @return Client
*/
*/
private
function
getClient
():
Client
private
function
getClient
():
Client
{
{
// Check clamd server's state
// Check clamd server's state
$this
->
client
->
ping
();
$this
->
client
->
ping
();
return
$this
->
client
;
return
$this
->
client
;
}
}
}
}
Tests/Listener/VirusScannerListenerTest.php
View file @
cd985e6a
...
@@ -40,7 +40,7 @@ class VirusScannerListenerTest extends PHPUnit_Framework_TestCase
...
@@ -40,7 +40,7 @@ class VirusScannerListenerTest extends PHPUnit_Framework_TestCase
protected
$file
;
protected
$file
;
/**
/**
* {@inherit
D
oc}
* {@inherit
d
oc}
*/
*/
protected
function
setUp
()
protected
function
setUp
()
{
{
...
@@ -93,7 +93,7 @@ class VirusScannerListenerTest extends PHPUnit_Framework_TestCase
...
@@ -93,7 +93,7 @@ class VirusScannerListenerTest extends PHPUnit_Framework_TestCase
}
}
/**
/**
* @expectedException Xenolope\Quahog\Exception\ConnectionException
* @expectedException
\
Xenolope\Quahog\Exception\ConnectionException
*/
*/
public
function
testGetClientFailed
()
public
function
testGetClientFailed
()
{
{
...
@@ -106,5 +106,4 @@ class VirusScannerListenerTest extends PHPUnit_Framework_TestCase
...
@@ -106,5 +106,4 @@ class VirusScannerListenerTest extends PHPUnit_Framework_TestCase
$this
->
client
->
expects
(
$this
->
once
())
->
method
(
'ping'
)
->
willReturn
(
true
);
$this
->
client
->
expects
(
$this
->
once
())
->
method
(
'ping'
)
->
willReturn
(
true
);
$this
->
listener
->
onFileUploadCompleted
(
$this
->
event
);
$this
->
listener
->
onFileUploadCompleted
(
$this
->
event
);
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment