diff options
author | LEDfan <tobia@ledfan.be> | 2014-12-08 13:18:00 +0100 |
---|---|---|
committer | LEDfan <tobia@ledfan.be> | 2014-12-08 13:18:00 +0100 |
commit | 3d11e091d95a87bd4d85895b51bac69b349caa7f (patch) | |
tree | 4bbed791235a20cf7d81c13b1fc0da0eaa48626d /tests | |
parent | c05ff0965198c61068924e81d35cba3549452ce3 (diff) | |
download | nextcloud-server-3d11e091d95a87bd4d85895b51bac69b349caa7f.tar.gz nextcloud-server-3d11e091d95a87bd4d85895b51bac69b349caa7f.zip |
Mock interface
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/contactsmanager.php | 39 |
1 files changed, 9 insertions, 30 deletions
diff --git a/tests/lib/contactsmanager.php b/tests/lib/contactsmanager.php index 20341ea455a..39e44cc6302 100644 --- a/tests/lib/contactsmanager.php +++ b/tests/lib/contactsmanager.php @@ -60,7 +60,7 @@ class Test_ContactsManager extends \Test\TestCase { * @dataProvider searchProvider */ public function testSearch($search1, $search2, $expectedResult ){ - $addressbook1 = $this->getMockBuilder('SimpleAddressbook') + $addressbook1 = $this->getMockBuilder('\OCP\IAddressBook') ->disableOriginalConstructor() ->getMock(); @@ -72,7 +72,7 @@ class Test_ContactsManager extends \Test\TestCase { ->method('getKey') ->willReturn('simple:1'); - $addressbook2 = $this->getMockBuilder('SimpleAddressbook') + $addressbook2 = $this->getMockBuilder('\OCP\IAddressBook') ->disableOriginalConstructor() ->getMock(); @@ -93,7 +93,7 @@ class Test_ContactsManager extends \Test\TestCase { public function testDeleteHavePermission(){ - $addressbook = $this->getMockBuilder('SimpleAddressbook') + $addressbook = $this->getMockBuilder('\OCP\IAddressBook') ->disableOriginalConstructor() ->getMock(); @@ -112,7 +112,7 @@ class Test_ContactsManager extends \Test\TestCase { } public function testDeleteNoPermission(){ - $addressbook = $this->getMockBuilder('SimpleAddressbook') + $addressbook = $this->getMockBuilder('\OCP\IAddressBook') ->disableOriginalConstructor() ->getMock(); @@ -129,7 +129,7 @@ class Test_ContactsManager extends \Test\TestCase { } public function testDeleteNoAddressbook(){ - $addressbook = $this->getMockBuilder('SimpleAddressbook') + $addressbook = $this->getMockBuilder('\OCP\IAddressBook') ->disableOriginalConstructor() ->getMock(); @@ -143,7 +143,7 @@ class Test_ContactsManager extends \Test\TestCase { } public function testCreateOrUpdateHavePermission(){ - $addressbook = $this->getMockBuilder('SimpleAddressbook') + $addressbook = $this->getMockBuilder('\OCP\IAddressBook') ->disableOriginalConstructor() ->getMock(); @@ -161,7 +161,7 @@ class Test_ContactsManager extends \Test\TestCase { } public function testCreateOrUpdateNoPermission(){ - $addressbook = $this->getMockBuilder('SimpleAddressbook') + $addressbook = $this->getMockBuilder('\OCP\IAddressBook') ->disableOriginalConstructor() ->getMock(); @@ -179,7 +179,7 @@ class Test_ContactsManager extends \Test\TestCase { } public function testCreateOrUpdateNOAdressbook(){ - $addressbook = $this->getMockBuilder('SimpleAddressbook') + $addressbook = $this->getMockBuilder('\OCP\IAddressBook') ->disableOriginalConstructor() ->getMock(); @@ -197,7 +197,7 @@ class Test_ContactsManager extends \Test\TestCase { } public function testIsEnabledIfSo(){ - $addressbook = $this->getMockBuilder('SimpleAddressbook') + $addressbook = $this->getMockBuilder('\OCP\IAddressBook') ->disableOriginalConstructor() ->getMock(); @@ -206,25 +206,4 @@ class Test_ContactsManager extends \Test\TestCase { $this->assertTrue($result); } -} - -class SimpleAddressbook implements \OCP\IAddressBook { - - public function getKey(){ - } - - public function getDisplayName(){ - } - - public function search($pattern, $searchProperties, $options){ - } - - public function createOrUpdate($properties){ - } - - public function getPermissions(){ - } - - public function delete($id){ - } }
\ No newline at end of file |