-
tests/Unit/Services/KeyServiceTest.php
Open in GitHubuse Mockery; use Tests\TestCase; class KeyServiceTest extends TestCase { // public function keyRemaining($kc, $nouk, $expected) { $mock = Mockery::mock(KeyService::class)->makePartial(); $mock->shouldReceive([ 'keyCapacity' => $kc, 'numberOfUsedKey' => $nouk, ]); $actual = $mock->keyRemaining(); $this->assertSame($expected, $actual); } public function keyRemainingInPercent($kc, $nouk, $expected) { $mock = Mockery::mock(KeyService::class)->makePartial(); $mock->shouldReceive([ 'keyCapacity' => $kc, 'numberOfUsedKey' => $nouk, ]); $actual = $mock->keyRemainingInPercent(); $this->assertSame($expected, $actual); } // }