diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2020-07-09 17:25:30 +0200 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2020-07-09 17:30:29 +0200 |
commit | 8cd975f325b3fcc8deb3cb53f4af56eab453eeb0 (patch) | |
tree | 2312f01d889f03a60ddd890e5bbfcd533c619680 /tests | |
parent | 73823f4507c7e139ad45bef90b31a0d68e7aea45 (diff) |
Fix syntax
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/ContactsMenu/Provider/DetailsProviderTest.php | 113 | ||||
-rw-r--r-- | tests/unit/Controller/PageControllerTest.php | 4 |
2 files changed, 57 insertions, 60 deletions
diff --git a/tests/unit/ContactsMenu/Provider/DetailsProviderTest.php b/tests/unit/ContactsMenu/Provider/DetailsProviderTest.php index a6d33cb0..41e73050 100644 --- a/tests/unit/ContactsMenu/Provider/DetailsProviderTest.php +++ b/tests/unit/ContactsMenu/Provider/DetailsProviderTest.php @@ -105,69 +105,69 @@ class DetailsProviderTest extends Base { $this->config->expects($this->at(0)) - ->method('getSystemValue') - ->with('version', '0.0.0') - ->willReturn($version); + ->method('getSystemValue') + ->with('version', '0.0.0') + ->willReturn($version); $this->config->expects($this->at(1)) - ->method('getSystemValue') - ->with('htaccess.IgnoreFrontController', false) - ->willReturn($frontControllerActive); + ->method('getSystemValue') + ->with('htaccess.IgnoreFrontController', false) + ->willReturn($frontControllerActive); $entry->expects($this->exactly(3)) - ->method('getProperty') - ->will($this->returnValueMap([ - ['UID', $uid], - ['isLocalSystemBook', null], - ['addressbook-key', 1] - ])); + ->method('getProperty') + ->will($this->returnValueMap([ + ['UID', $uid], + ['isLocalSystemBook', null], + ['addressbook-key', 1] + ])); $addressbook->expects($this->once()) - ->method('getKey') - ->willReturn(1); + ->method('getKey') + ->willReturn(1); $addressbook->expects($this->once()) - ->method('getUri') - ->willReturn($abUri); + ->method('getUri') + ->willReturn($abUri); $this->manager->expects($this->once()) - ->method('getUserAddressbooks') - ->willReturn([1 => $addressbook]); + ->method('getUserAddressbooks') + ->willReturn([1 => $addressbook]); // Action icon $this->urlGenerator->expects($this->once()) - ->method('imagePath') - ->with('core', 'actions/info.svg') - ->willReturn($iconUrl); + ->method('imagePath') + ->with('core', 'actions/info.svg') + ->willReturn($iconUrl); // Action icon and contact absolute urls $this->urlGenerator->expects($this->exactly(2)) - ->method('getAbsoluteURL') - ->will($this->returnValueMap([ - [$iconUrl, "$domain/$iconUrl"], - ["$index/apps/contacts/$defaultGroup/$uid~$abUri", "$domain$index/apps/contacts/$defaultGroup/$uid~$abUri"] - ])); + ->method('getAbsoluteURL') + ->will($this->returnValueMap([ + [$iconUrl, "$domain/$iconUrl"], + ["$index/apps/contacts/$defaultGroup/$uid~$abUri", "$domain$index/apps/contacts/$defaultGroup/$uid~$abUri"] + ])); // Translations $this->l10n->expects($this->at(0)) - ->method('t') - ->with($defaultGroup) - ->willReturn($defaultGroup); + ->method('t') + ->with($defaultGroup) + ->willReturn($defaultGroup); $this->l10n->expects($this->at(1)) - ->method('t') - ->with('Details') + ->method('t') + ->with('Details') ->willReturnArgument(0); $this->actionFactory->expects($this->once()) - ->method('newLinkAction') - ->with($this->equalTo("$domain/$iconUrl"), $this->equalTo('Details'), $this->equalTo($resultUri)) - ->willReturn($action); + ->method('newLinkAction') + ->with($this->equalTo("$domain/$iconUrl"), $this->equalTo('Details'), $this->equalTo($resultUri)) + ->willReturn($action); $action->expects($this->once()) - ->method('setPriority') - ->with($this->equalTo(0)); + ->method('setPriority') + ->with($this->equalTo(0)); $entry->expects($this->once()) - ->method('addAction') - ->with($action); + ->method('addAction') + ->with($action); $this->provider->process($entry); } @@ -178,17 +178,17 @@ class DetailsProviderTest extends Base { */ public function testProcessNC15() { $this->config->expects($this->once()) - ->method('getSystemValue') - ->with('version', '0.0.0') - ->willReturn('15.0.0.0'); + ->method('getSystemValue') + ->with('version', '0.0.0') + ->willReturn('15.0.0.0'); $entry = $this->createMock(IEntry::class); $entry->expects($this->exactly(2)) - ->method('getProperty') - ->will($this->returnValueMap([ - ['UID', 'e3a71614-c602-4eb5-9994-47eec551542b'], - ['isLocalSystemBook', null] - ])); + ->method('getProperty') + ->will($this->returnValueMap([ + ['UID', 'e3a71614-c602-4eb5-9994-47eec551542b'], + ['isLocalSystemBook', null] + ])); $this->assertNull($this->provider->process($entry)); } @@ -196,11 +196,11 @@ class DetailsProviderTest extends Base { public function testProcessNoUID() { $entry = $this->createMock(IEntry::class); $entry->expects($this->once()) - ->method('getProperty') - ->with($this->equalTo('UID')) - ->willReturn(null); + ->method('getProperty') + ->with($this->equalTo('UID')) + ->willReturn(null); $entry->expects($this->never()) - ->method('addAction'); + ->method('addAction'); $this->provider->process($entry); } @@ -208,15 +208,14 @@ class DetailsProviderTest extends Base { public function testProcessSystemContact() { $entry = $this->createMock(IEntry::class); $entry->expects($this->exactly(2)) - ->method('getProperty') - ->will($this->returnValueMap([ - ['UID', 1234], - ['isLocalSystemBook', true] - ])); + ->method('getProperty') + ->will($this->returnValueMap([ + ['UID', 1234], + ['isLocalSystemBook', true] + ])); $entry->expects($this->never()) - ->method('addAction'); + ->method('addAction'); $this->provider->process($entry); } - } diff --git a/tests/unit/Controller/PageControllerTest.php b/tests/unit/Controller/PageControllerTest.php index 1673269e..d86f055b 100644 --- a/tests/unit/Controller/PageControllerTest.php +++ b/tests/unit/Controller/PageControllerTest.php @@ -31,9 +31,7 @@ use OCP\IRequest; use OCP\L10N\IFactory; use ChristophWurst\Nextcloud\Testing\TestCase; - class PageControllerTest extends TestCase { - private $controller; /** @var IRequest|MockObject */ @@ -46,7 +44,7 @@ class PageControllerTest extends TestCase { private $languageFactory; /** @var IConfig|MockObject*/ - private $config; + private $config; public function setUp() { |