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 <ilovemilk@wusa.io>2019-05-17 17:31:02 +0300
committerMatthias <ilovemilk@wusa.io>2019-05-17 17:31:02 +0300
commitd8ae5922cecde8d651db143589547257c5e0377a (patch)
treea2401cc9ef80e7d1d09b2efb5894b5f6e6aa0231 /tests
parentfd88a4369e91ca11358516047803f9c309bfa2d9 (diff)
fix number of parameters
Diffstat (limited to 'tests')
-rw-r--r--tests/Unit/Analyzer/EntropyAnalyzerTest.php31
1 files changed, 3 insertions, 28 deletions
diff --git a/tests/Unit/Analyzer/EntropyAnalyzerTest.php b/tests/Unit/Analyzer/EntropyAnalyzerTest.php
index 656070e..af220df 100644
--- a/tests/Unit/Analyzer/EntropyAnalyzerTest.php
+++ b/tests/Unit/Analyzer/EntropyAnalyzerTest.php
@@ -95,46 +95,21 @@ class EntropyAnalyzerTest extends TestCase
$this->assertEquals($result->getStandardDeviation(), $standardDeviation);
}
- public function testCreateEntropyArrayFromFile()
+ public function testCalculateStandardDeviationOfEntropy()
{
- $this->markTestSkipped('getContent was removed.');
- $entropyAnalyzer = $this->getMockBuilder(EntropyAnalyzer::class)
- ->setConstructorArgs([$this->logger, $this->rootFolder, $this->entropy, $this->userId])
- ->setMethods(array('createEntropyArrayFromData'))
- ->getMock();
+ $entropyAnalyzer = new EntropyAnalyzer($this->logger, $this->rootFolder, $this->entropy, $this->userId);
$node = $this->createMock(File::class);
$node->method('getContent')
->willReturn('test');
- $userRoot = $this->createMock(Folder::class);
- $userRoot->method('get')
- ->willReturn($node);
-
- $userFolder = $this->createMock(Folder::class);
- $userFolder->method('getParent')
- ->willReturn($userRoot);
-
- $this->rootFolder->method('getUserFolder')
- ->willReturn($userFolder);
-
- $entropyAnalyzer->method('createEntropyArrayFromData')
- ->willReturn([]);
-
- $this->assertEquals($this->invokePrivate($entropyAnalyzer, 'createEntropyArrayFromFile', [$node, EntropyAnalyzer::BLOCK_SIZE]), []);
- }
-
- public function testCalculateStandardDeviationOfEntropy()
- {
- $entropyAnalyzer = new EntropyAnalyzer($this->logger, $this->rootFolder, $this->entropy, $this->userId);
-
$this->entropy->method('streamMean')
->willReturn(0.002);
$this->entropy->method('streamStandardDeviation')
->willReturn(0.004);
- $this->assertEquals($this->invokePrivate($entropyAnalyzer, 'calculateStandardDeviationOfEntropy', [[]]), 0.004);
+ $this->assertEquals($this->invokePrivate($entropyAnalyzer, 'calculateStandardDeviationOfEntropy', [$nodes, EntropyAnalyzer::BLOCK_SIZE]), 0.004);
}
public function testCalculateEntropyOfFile()