diff options
author | Matthias <ilovemilk@wusa.io> | 2019-05-17 17:31:02 +0300 |
---|---|---|
committer | Matthias <ilovemilk@wusa.io> | 2019-05-17 17:31:02 +0300 |
commit | d8ae5922cecde8d651db143589547257c5e0377a (patch) | |
tree | a2401cc9ef80e7d1d09b2efb5894b5f6e6aa0231 /tests | |
parent | fd88a4369e91ca11358516047803f9c309bfa2d9 (diff) |
fix number of parameters
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Unit/Analyzer/EntropyAnalyzerTest.php | 31 |
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() |