Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/undo-ransomware/ransomware_detection.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMatthias Held <ilovemilk@wusa.io>2018-08-29 23:26:01 +0300
committerMatthias Held <ilovemilk@wusa.io>2018-08-29 23:26:01 +0300
commit3dbea00f5b83fa58ef05e79c65f29c61faa541c1 (patch)
tree7a727c81236a82422e3e7fb9fb2c7ec6d0350919 /tests
parent452adadb10e4cc7f2a66650719241c7654144bb1 (diff)
Fix scan recovery
Diffstat (limited to 'tests')
-rw-r--r--tests/Unit/Controller/ScanControllerTest.php18
1 files changed, 10 insertions, 8 deletions
diff --git a/tests/Unit/Controller/ScanControllerTest.php b/tests/Unit/Controller/ScanControllerTest.php
index 13960e2..85fa9ce 100644
--- a/tests/Unit/Controller/ScanControllerTest.php
+++ b/tests/Unit/Controller/ScanControllerTest.php
@@ -147,12 +147,12 @@ class ScanControllerTest extends TestCase
public function dataRecover()
{
return [
- ['id' => 4, 'command' => Monitor::DELETE, 'path' => '/test.pdf', 'timestamp' => 12345, 'restored' => false, 'response' => Http::STATUS_BAD_REQUEST],
- ['id' => 4, 'command' => Monitor::DELETE, 'path' => '/test.pdf', 'timestamp' => 12345, 'restored' => true, 'response' => Http::STATUS_OK],
- ['id' => 4, 'command' => Monitor::WRITE, 'path' => '/test.pdf', 'timestamp' => 12345, 'restored' => true, 'response' => Http::STATUS_OK],
- ['id' => 4, 'command' => Monitor::WRITE, 'path' => '/test.pdf', 'timestamp' => 12345, 'restored' => false, 'response' => Http::STATUS_BAD_REQUEST],
- ['id' => 4, 'command' => Monitor::CREATE, 'path' => '/test.pdf', 'timestamp' => 12345, 'restored' => false, 'response' => Http::STATUS_BAD_REQUEST],
- ['id' => 4, 'command' => Monitor::RENAME, 'path' => '/test.pdf', 'timestamp' => 12345, 'restored' => false, 'response' => Http::STATUS_BAD_REQUEST],
+ ['id' => 4, 'sequence' => 5, 'command' => Monitor::DELETE, 'path' => '/', 'name' => 'test.pdf', 'timestamp' => 12345, 'restored' => false, 'response' => Http::STATUS_OK],
+ ['id' => 4, 'sequence' => 5, 'command' => Monitor::DELETE, 'path' => '/', 'name' => 'test.pdf', 'timestamp' => 12345, 'restored' => true, 'response' => Http::STATUS_OK],
+ ['id' => 4, 'sequence' => 5, 'command' => Monitor::WRITE, 'path' => '/', 'name' => 'test.pdf', 'timestamp' => 12345, 'restored' => true, 'response' => Http::STATUS_OK],
+ ['id' => 4, 'sequence' => 5, 'command' => Monitor::WRITE, 'path' => '/', 'name' => 'test.pdf', 'timestamp' => 12345, 'restored' => false, 'response' => Http::STATUS_OK],
+ ['id' => 4, 'sequence' => 5, 'command' => Monitor::CREATE, 'path' => '/', 'name' => 'test.pdf', 'timestamp' => 12345, 'restored' => false, 'response' => Http::STATUS_BAD_REQUEST],
+ ['id' => 4, 'sequence' => 5, 'command' => Monitor::RENAME, 'path' => '/', 'name' => 'test.pdf', 'timestamp' => 12345, 'restored' => false, 'response' => Http::STATUS_BAD_REQUEST],
];
}
@@ -160,13 +160,15 @@ class ScanControllerTest extends TestCase
* @dataProvider dataRecover
*
* @param integer $id
+ * @param integer $sequence
* @param integer $command
* @param string $path
+ * @param string $name
* @param integer $timestamp
* @param boolean $restored
* @param HttpResponse $response
*/
- public function testRecover($id, $command, $path, $timestamp, $restored, $response)
+ public function testRecover($id, $sequence, $command, $path, $name, $timestamp, $restored, $response)
{
$controller = $this->getMockBuilder(ScanController::class)
->setConstructorArgs(['ransomware_detection', $this->request, $this->userSession, $this->config, $this->classifier,
@@ -183,7 +185,7 @@ class ScanControllerTest extends TestCase
->method('restoreFromTrashbin')
->willReturn($restored);
- $result = $controller->recover($id, $command, $path ,$timestamp);
+ $result = $controller->recover($id, $sequence, $command, $path ,$timestamp);
$this->assertTrue($result instanceof JSONResponse);
$this->assertEquals($result->getStatus(), $response);
}