Skip to content

Commit

Permalink
Merge pull request #66 from owncloud/fix-qa-error
Browse files Browse the repository at this point in the history
fix for #63, do not implement set method for entity property
  • Loading branch information
Vincent Petry authored Sep 28, 2018
2 parents ff98b19 + fe4f62d commit e2fe46c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 23 deletions.
25 changes: 3 additions & 22 deletions lib/Db/TotpSecret.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand All @@ -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;
}

}
5 changes: 4 additions & 1 deletion tests/unit/Service/TotpTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit e2fe46c

Please sign in to comment.