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
diff options
context:
space:
mode:
authorMatthias <ilovemilk@wusa.io>2020-09-20 15:10:35 +0300
committerMatthias <ilovemilk@wusa.io>2020-09-20 15:10:35 +0300
commit0c49bd67b8ab7e36e6d114b07f7f3c4360148a9b (patch)
tree56ce9d96653669a22bc032b5eaea9e1c255e42bc
parentdd0299365c922c2befaddcce6df679ad11283d5e (diff)
fix tests
-rw-r--r--tests/Unit/Controller/FileOperationControllerTest.php2
-rw-r--r--tests/Unit/Controller/SettingsControllerTest.php4
-rw-r--r--tests/Unit/Service/FileOperationServiceTest.php5
3 files changed, 8 insertions, 3 deletions
diff --git a/tests/Unit/Controller/FileOperationControllerTest.php b/tests/Unit/Controller/FileOperationControllerTest.php
index 731d2d3..04e6fc5 100644
--- a/tests/Unit/Controller/FileOperationControllerTest.php
+++ b/tests/Unit/Controller/FileOperationControllerTest.php
@@ -123,7 +123,7 @@ class FileOperationControllerTest extends TestCase
$result = $controller->findAll();
$this->assertTrue($result instanceof JSONResponse);
- $this->assertEquals($result->getStatus(), Http::STATUS_ACCEPTED);
+ $this->assertEquals($result->getStatus(), Http::STAUTS_OK);
}
public function dataRecover()
diff --git a/tests/Unit/Controller/SettingsControllerTest.php b/tests/Unit/Controller/SettingsControllerTest.php
index 7ebff04..8c2fd5f 100644
--- a/tests/Unit/Controller/SettingsControllerTest.php
+++ b/tests/Unit/Controller/SettingsControllerTest.php
@@ -66,7 +66,7 @@ class SettingsControllerTest extends TestCase
$result = $controller->findAll();
$this->assertTrue($result instanceof JSONResponse);
- $this->assertEquals($result->getStatus(), Http::STATUS_ACCEPTED);
+ $this->assertEquals($result->getStatus(), Http::STAUTS_OK);
}
public function testChangeColorMode()
@@ -81,6 +81,6 @@ class SettingsControllerTest extends TestCase
$result = $controller->update(1, 0);
$this->assertTrue($result instanceof JSONResponse);
- $this->assertEquals($result->getStatus(), Http::STATUS_ACCEPTED);
+ $this->assertEquals($result->getStatus(), Http::STAUTS_OK);
}
}
diff --git a/tests/Unit/Service/FileOperationServiceTest.php b/tests/Unit/Service/FileOperationServiceTest.php
index 5333fc0..51037ce 100644
--- a/tests/Unit/Service/FileOperationServiceTest.php
+++ b/tests/Unit/Service/FileOperationServiceTest.php
@@ -214,6 +214,11 @@ class FileOperationServiceTest extends MapperTestUtility
$fileOperation->setUserId($userId);
$fileOperation->setId(3);
+ $sql = 'SELECT * FROM `*PREFIX*ransomware_detection` WHERE `id` = ? AND `user_id` = ?';
+ $arguments = [$fileOperation->getId(), $userId];
+
+ $this->setMapperResult($sql, $arguments, [], null, null, true);
+
$sql = 'DELETE FROM `*PREFIX*ransomware_detection` WHERE `id` = ? AND `user_id` = ?';
$arguments = [$fileOperation->getId(), $userId];