Fix more tests

This commit is contained in:
Joas Schilling 2016-09-20 14:28:17 +02:00
parent d9063b6141
commit 94b0315d7a
No known key found for this signature in database
GPG Key ID: E166FD8976B3BAC8
1 changed files with 4 additions and 4 deletions

View File

@ -51,15 +51,15 @@ class ApplicationTest extends TestCase {
public function testContactsManagerSetup() {
$app = new Application();
$c = $app->getContainer();
$c->registerService('CardDavBackend', function($c) {
$service = $this->getMockBuilder('OCA\DAV\CardDAV\CardDavBackend')->disableOriginalConstructor()->getMock();
$c->registerService(CardDavBackend::class, function() {
$service = $this->createMock(CardDavBackend::class);
$service->method('getAddressBooksForUser')->willReturn([]);
return $service;
});
// assert setupContactsProvider() is proper
/** @var IManager | \PHPUnit_Framework_MockObject_MockObject $cm */
$cm = $this->getMockBuilder('OCP\Contacts\IManager')->disableOriginalConstructor()->getMock();
/** @var IManager|\PHPUnit_Framework_MockObject_MockObject $cm */
$cm = $this->createMock(IManager::class);
$app->setupContactsProvider($cm, 'xxx');
$this->assertTrue(true);
}