Mock interface

This commit is contained in:
LEDfan 2014-12-08 13:18:00 +01:00
parent c05ff09651
commit 3d11e091d9
1 changed files with 9 additions and 30 deletions

View File

@ -60,7 +60,7 @@ class Test_ContactsManager extends \Test\TestCase {
* @dataProvider searchProvider * @dataProvider searchProvider
*/ */
public function testSearch($search1, $search2, $expectedResult ){ public function testSearch($search1, $search2, $expectedResult ){
$addressbook1 = $this->getMockBuilder('SimpleAddressbook') $addressbook1 = $this->getMockBuilder('\OCP\IAddressBook')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
@ -72,7 +72,7 @@ class Test_ContactsManager extends \Test\TestCase {
->method('getKey') ->method('getKey')
->willReturn('simple:1'); ->willReturn('simple:1');
$addressbook2 = $this->getMockBuilder('SimpleAddressbook') $addressbook2 = $this->getMockBuilder('\OCP\IAddressBook')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
@ -93,7 +93,7 @@ class Test_ContactsManager extends \Test\TestCase {
public function testDeleteHavePermission(){ public function testDeleteHavePermission(){
$addressbook = $this->getMockBuilder('SimpleAddressbook') $addressbook = $this->getMockBuilder('\OCP\IAddressBook')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
@ -112,7 +112,7 @@ class Test_ContactsManager extends \Test\TestCase {
} }
public function testDeleteNoPermission(){ public function testDeleteNoPermission(){
$addressbook = $this->getMockBuilder('SimpleAddressbook') $addressbook = $this->getMockBuilder('\OCP\IAddressBook')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
@ -129,7 +129,7 @@ class Test_ContactsManager extends \Test\TestCase {
} }
public function testDeleteNoAddressbook(){ public function testDeleteNoAddressbook(){
$addressbook = $this->getMockBuilder('SimpleAddressbook') $addressbook = $this->getMockBuilder('\OCP\IAddressBook')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
@ -143,7 +143,7 @@ class Test_ContactsManager extends \Test\TestCase {
} }
public function testCreateOrUpdateHavePermission(){ public function testCreateOrUpdateHavePermission(){
$addressbook = $this->getMockBuilder('SimpleAddressbook') $addressbook = $this->getMockBuilder('\OCP\IAddressBook')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
@ -161,7 +161,7 @@ class Test_ContactsManager extends \Test\TestCase {
} }
public function testCreateOrUpdateNoPermission(){ public function testCreateOrUpdateNoPermission(){
$addressbook = $this->getMockBuilder('SimpleAddressbook') $addressbook = $this->getMockBuilder('\OCP\IAddressBook')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
@ -179,7 +179,7 @@ class Test_ContactsManager extends \Test\TestCase {
} }
public function testCreateOrUpdateNOAdressbook(){ public function testCreateOrUpdateNOAdressbook(){
$addressbook = $this->getMockBuilder('SimpleAddressbook') $addressbook = $this->getMockBuilder('\OCP\IAddressBook')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
@ -197,7 +197,7 @@ class Test_ContactsManager extends \Test\TestCase {
} }
public function testIsEnabledIfSo(){ public function testIsEnabledIfSo(){
$addressbook = $this->getMockBuilder('SimpleAddressbook') $addressbook = $this->getMockBuilder('\OCP\IAddressBook')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
@ -207,24 +207,3 @@ class Test_ContactsManager extends \Test\TestCase {
} }
} }
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){
}
}