diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2013-02-06 12:29:51 -0800 |
---|---|---|
committer | Lukas Reschke <lukas@statuscode.ch> | 2013-02-06 12:29:51 -0800 |
commit | 2dfe67423da377999de7d3e239adf658bf6df0b5 (patch) | |
tree | 88ada778b45d5056c97591bec06ee2d324eeadbf | |
parent | e969a78cf998a6a5607e605d65b7bf1b35259cb8 (diff) | |
parent | a4d3cc798fe8b9ee4d0c13ee89059129b265c6b8 (diff) | |
download | nextcloud-server-2dfe67423da377999de7d3e239adf658bf6df0b5.tar.gz nextcloud-server-2dfe67423da377999de7d3e239adf658bf6df0b5.zip |
Merge pull request #1509 from owncloud/correct-public-contacts-tests
Correct lib/public/contacts.php tests
-rw-r--r-- | lib/public/contacts.php | 4 | ||||
-rw-r--r-- | tests/lib/public/contacts.php | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/public/contacts.php b/lib/public/contacts.php index 44d82c37908..88d812e735a 100644 --- a/lib/public/contacts.php +++ b/lib/public/contacts.php @@ -149,14 +149,14 @@ namespace OCP { /** * @param \OCP\IAddressBook $address_book */ - public static function registerAddressBook($address_book) { + public static function registerAddressBook(\OCP\IAddressBook $address_book) { self::$address_books[$address_book->getKey()] = $address_book; } /** * @param \OCP\IAddressBook $address_book */ - public static function unregisterAddressBook($address_book) { + public static function unregisterAddressBook(\OCP\IAddressBook $address_book) { unset(self::$address_books[$address_book->getKey()]); } diff --git a/tests/lib/public/contacts.php b/tests/lib/public/contacts.php index 23994667a26..ce5d762226b 100644 --- a/tests/lib/public/contacts.php +++ b/tests/lib/public/contacts.php @@ -39,7 +39,7 @@ class Test_Contacts extends PHPUnit_Framework_TestCase public function testEnabledAfterRegister() { // create mock for the addressbook - $stub = $this->getMock("SimpleAddressBook", array('getKey')); + $stub = $this->getMockForAbstractClass("OCP\IAddressBook", array('getKey')); // we expect getKey to be called twice: // first time on register @@ -65,7 +65,7 @@ class Test_Contacts extends PHPUnit_Framework_TestCase public function testAddressBookEnumeration() { // create mock for the addressbook - $stub = $this->getMock("SimpleAddressBook", array('getKey', 'getDisplayName')); + $stub = $this->getMockForAbstractClass("OCP\IAddressBook", array('getKey', 'getDisplayName')); // setup return for method calls $stub->expects($this->any()) @@ -85,8 +85,8 @@ class Test_Contacts extends PHPUnit_Framework_TestCase public function testSearchInAddressBook() { // create mock for the addressbook - $stub1 = $this->getMock("SimpleAddressBook1", array('getKey', 'getDisplayName', 'search')); - $stub2 = $this->getMock("SimpleAddressBook2", array('getKey', 'getDisplayName', 'search')); + $stub1 = $this->getMockForAbstractClass("OCP\IAddressBook", array('getKey', 'getDisplayName', 'search')); + $stub2 = $this->getMockForAbstractClass("OCP\IAddressBook", array('getKey', 'getDisplayName', 'search')); $searchResult1 = array( array('id' => 0, 'FN' => 'Frank Karlitschek', 'EMAIL' => 'a@b.c', 'GEO' => '37.386013;-122.082932'), |