diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2016-11-07 16:57:47 +0300 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2016-11-07 18:45:18 +0300 |
commit | 3dfa737e736be1a4979881a63d0783a17b88965a (patch) | |
tree | 707cac98d424653468bf0fa5fc8f86f38531c85d /tests | |
parent | 5c4487a81835761ba163a521f4ee76c15578dfc2 (diff) |
use phpunit's createMock for interfaces
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/Controller/SettingsControllerTest.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/unit/Controller/SettingsControllerTest.php b/tests/unit/Controller/SettingsControllerTest.php index e2358ad..e6ea5d8 100644 --- a/tests/unit/Controller/SettingsControllerTest.php +++ b/tests/unit/Controller/SettingsControllerTest.php @@ -39,16 +39,16 @@ class SettingsControllerTest extends TestCase { protected function setUp() { parent::setUp(); - $this->request = $this->getMock('\OCP\IRequest'); - $this->userSession = $this->getMock('\OCP\IUserSession'); - $this->totp = $this->getMock('\OCA\TwoFactorTOTP\Service\ITotp'); + $this->request = $this->createMock('\OCP\IRequest'); + $this->userSession = $this->createMock('\OCP\IUserSession'); + $this->totp = $this->createMock('\OCA\TwoFactorTOTP\Service\ITotp'); $this->defaults = new Defaults(); $this->controller = new SettingsController('twofactor_totp', $this->request, $this->userSession, $this->totp, $this->defaults); } public function testNothing() { - $user = $this->getMock('\OCP\IUser'); + $user = $this->createMock('\OCP\IUser'); $this->userSession->expects($this->once()) ->method('getUser') ->will($this->returnValue($user)); @@ -65,7 +65,7 @@ class SettingsControllerTest extends TestCase { } public function testEnable() { - $user = $this->getMock('\OCP\IUser'); + $user = $this->createMock('\OCP\IUser'); $this->userSession->expects($this->exactly(2)) ->method('getUser') ->will($this->returnValue($user)); @@ -93,7 +93,7 @@ class SettingsControllerTest extends TestCase { } public function testEnableDisable() { - $user = $this->getMock('\OCP\IUser'); + $user = $this->createMock('\OCP\IUser'); $this->userSession->expects($this->once()) ->method('getUser') ->will($this->returnValue($user)); |