diff --git a/lib/Db/TotpSecret.php b/lib/Db/TotpSecret.php index 0d33a8b..fb518b7 100644 --- a/lib/Db/TotpSecret.php +++ b/lib/Db/TotpSecret.php @@ -27,9 +27,12 @@ /** * @method string getUserId() * @method void setUserId(string $userId) + * @method string getSecret() * @method void setSecret(string $secret) * @method boolean getVerified() * @method void setVerified(bool $verified) + * @method string getLastValidatedKey() + * @method void setLastValidatedKey(string $lastValidatedKey) */ class TotpSecret extends Entity { @@ -44,26 +47,4 @@ class TotpSecret extends Entity { /** @var boolean */ protected $verified; - - /** - * @return string - */ - public function getSecret() { - return $this->secret; - } - - /** - * @return string - */ - public function getLastValidatedKey() { - return $this->lastValidatedKey; - } - - /** - * @param string $key - */ - public function setLastValidatedKey($key) { - $this->lastValidatedKey = $key; - } - } diff --git a/tests/unit/Service/TotpTest.php b/tests/unit/Service/TotpTest.php index 4976cb8..d5ba259 100644 --- a/tests/unit/Service/TotpTest.php +++ b/tests/unit/Service/TotpTest.php @@ -68,7 +68,10 @@ protected function setUp() { public function testValidateSecret($lastKey, $key, $validationResult, $expectedResult) { /** @var IUser | \PHPUnit_Framework_MockObject_MockObject $user */ $user = $this->createMock(IUser::class); - $dbSecret = $this->createMock(TotpSecret::class); + $dbSecret = $this + ->getMockBuilder(TotpSecret::class) + ->setMethods(['getSecret', 'getLastValidatedKey', 'setLastValidatedKey']) + ->getMock(); $dbSecret->expects($this->once()) ->method('getLastValidatedKey')