Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLEDfan <tobia@ledfan.be>2014-12-08 15:18:00 +0300
committerLEDfan <tobia@ledfan.be>2014-12-08 15:18:00 +0300
commit3d11e091d95a87bd4d85895b51bac69b349caa7f (patch)
tree4bbed791235a20cf7d81c13b1fc0da0eaa48626d /tests
parentc05ff0965198c61068924e81d35cba3549452ce3 (diff)
Mock interface
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/contactsmanager.php39
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