From f9dbaf6f2ab1b9567daad91f79d6a68d45b8cde4 Mon Sep 17 00:00:00 2001 From: Julius Härtl Date: Mon, 29 Jan 2018 11:33:09 +0100 Subject: Make sure we test the proper order in the NavigationManagerTest MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- tests/lib/NavigationManagerTest.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'tests') diff --git a/tests/lib/NavigationManagerTest.php b/tests/lib/NavigationManagerTest.php index 585161c887b..b34ecca9469 100644 --- a/tests/lib/NavigationManagerTest.php +++ b/tests/lib/NavigationManagerTest.php @@ -284,7 +284,7 @@ class NavigationManagerTest extends TestCase { ], ]; return [ - 'minimalistic' => [array_merge($defaults, [[ + 'minimalistic' => [array_merge([$defaults[0]], [[ 'id' => 'test', 'order' => 100, 'href' => '/apps/test/', @@ -293,8 +293,8 @@ class NavigationManagerTest extends TestCase { 'active' => false, 'type' => 'link', 'classes' => '', - ]]), ['navigations' => [['route' => 'test.page.index', 'name' => 'Test']]]], - 'minimalistic-settings' => [array_merge($defaults, [[ + ]], [$defaults[1]]), ['navigations' => [['route' => 'test.page.index', 'name' => 'Test']]]], + 'minimalistic-settings' => [array_merge([$defaults[0]], [[ 'id' => 'test', 'order' => 100, 'href' => '/apps/test/', @@ -303,8 +303,8 @@ class NavigationManagerTest extends TestCase { 'active' => false, 'type' => 'settings', 'classes' => '', - ]]), ['navigations' => [['route' => 'test.page.index', 'name' => 'Test', 'type' => 'settings']]]], - 'admin' => [array_merge($apps, $defaults, [[ + ]], [$defaults[1]]), ['navigations' => [['route' => 'test.page.index', 'name' => 'Test', 'type' => 'settings']]]], + 'admin' => [array_merge([$defaults[0]], $apps, [[ 'id' => 'test', 'order' => 100, 'href' => '/apps/test/', @@ -313,8 +313,8 @@ class NavigationManagerTest extends TestCase { 'active' => false, 'type' => 'link', 'classes' => '', - ]]), ['navigations' => [['@attributes' => ['role' => 'admin'], 'route' => 'test.page.index', 'name' => 'Test']]], true], - 'no name' => [array_merge($apps, $defaults), ['navigations' => [['@attributes' => ['role' => 'admin'], 'route' => 'test.page.index']]], true], + ]], [$defaults[1]]), ['navigations' => [['@attributes' => ['role' => 'admin'], 'route' => 'test.page.index', 'name' => 'Test']]], true], + 'no name' => [array_merge([$defaults[0]], $apps, [$defaults[1]]), ['navigations' => [['@attributes' => ['role' => 'admin'], 'route' => 'test.page.index']]], true], 'no admin' => [$defaults, ['navigations' => [['@attributes' => ['role' => 'admin'], 'route' => 'test.page.index', 'name' => 'Test']]]] ]; } -- cgit v1.2.3 From 6211d18dc103dac3bea6e7cf1c05dca6a8ccf774 Mon Sep 17 00:00:00 2001 From: Julius Härtl Date: Mon, 29 Jan 2018 12:18:11 +0100 Subject: Add tests for NavigationController MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- core/Controller/NavigationController.php | 4 +- tests/Core/Controller/NavigationControllerTest.php | 77 ++++++++++++++++++++++ 2 files changed, 79 insertions(+), 2 deletions(-) create mode 100644 tests/Core/Controller/NavigationControllerTest.php (limited to 'tests') diff --git a/core/Controller/NavigationController.php b/core/Controller/NavigationController.php index d5d8563b593..5850025f450 100644 --- a/core/Controller/NavigationController.php +++ b/core/Controller/NavigationController.php @@ -32,8 +32,8 @@ class NavigationController extends Controller { /** @var INavigationManager */ private $navigationManager; - public function __construct(IRequest $request, INavigationManager $navigationManager) { - parent::__construct('core', $request); + public function __construct(string $appName, IRequest $request, INavigationManager $navigationManager) { + parent::__construct($appName, $request); $this->navigationManager = $navigationManager; } diff --git a/tests/Core/Controller/NavigationControllerTest.php b/tests/Core/Controller/NavigationControllerTest.php new file mode 100644 index 00000000000..1e9acccb615 --- /dev/null +++ b/tests/Core/Controller/NavigationControllerTest.php @@ -0,0 +1,77 @@ + + * + * @author Julius Härtl + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ +namespace Tests\Core\Controller; + +use OC\Core\Controller\NavigationController; +use OCP\AppFramework\Http\JSONResponse; +use OCP\INavigationManager; +use OCP\IRequest; +use Test\TestCase; + +class NavigationControllerTest extends TestCase { + + /** @var IRequest|\PHPUnit_Framework_MockObject_MockObject */ + private $request; + + /** @var INavigationManager|\PHPUnit_Framework_MockObject_MockObject */ + private $navigationManager; + + /** @var NavigationController */ + private $controller; + + public function setUp() { + parent::setUp(); + + + $this->request = $this->createMock(IRequest::class); + $this->navigationManager = $this->createMock(INavigationManager::class); + + $this->controller = new NavigationController( + 'core', + $this->request, + $this->navigationManager + ); + } + + public function dataGetNavigation() { + return [ + [false], [true] + ]; + } + /** @dataProvider dataGetNavigation */ + public function testGetAppNavigation($absolute) { + $this->navigationManager->expects($this->once()) + ->method('getAll') + ->with('link', $absolute); + $this->assertInstanceOf(JSONResponse::class, $this->controller->getAppsNavigation($absolute)); + } + + /** @dataProvider dataGetNavigation */ + public function testGetSettingsNavigation($absolute) { + $this->navigationManager->expects($this->once()) + ->method('getAll') + ->with('settings', $absolute); + $this->assertInstanceOf(JSONResponse::class, $this->controller->getSettingsNavigation($absolute)); + } + +} -- cgit v1.2.3 From 8ecac5654323e5d335386874f01b15d680d0febb Mon Sep 17 00:00:00 2001 From: Julius Härtl Date: Mon, 29 Jan 2018 12:52:40 +0100 Subject: Allow requesting absolute URLs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit They might be useful when requesting the navigation from the clients Signed-off-by: Julius Härtl --- core/Controller/NavigationController.php | 38 ++++++++++++++--- tests/Core/Controller/NavigationControllerTest.php | 49 +++++++++++++++++++--- 2 files changed, 76 insertions(+), 11 deletions(-) (limited to 'tests') diff --git a/core/Controller/NavigationController.php b/core/Controller/NavigationController.php index 5850025f450..98744171198 100644 --- a/core/Controller/NavigationController.php +++ b/core/Controller/NavigationController.php @@ -26,34 +26,62 @@ use OCP\AppFramework\Controller; use OCP\AppFramework\Http\JSONResponse; use OCP\INavigationManager; use OCP\IRequest; +use OCP\IURLGenerator; class NavigationController extends Controller { /** @var INavigationManager */ private $navigationManager; - public function __construct(string $appName, IRequest $request, INavigationManager $navigationManager) { + /** @var IURLGenerator */ + private $urlGenerator; + + public function __construct(string $appName, IRequest $request, INavigationManager $navigationManager, IURLGenerator $urlGenerator) { parent::__construct($appName, $request); $this->navigationManager = $navigationManager; + $this->urlGenerator = $urlGenerator; } /** * @NoAdminRequired * @NoCSRFRequired * + * @param bool $absolute * @return JSONResponse */ - public function getAppsNavigation($absolute = false) { - return new JSONResponse($this->navigationManager->getAll('link', $absolute)); + public function getAppsNavigation(bool $absolute = false) { + $navigation = $this->navigationManager->getAll('link'); + if ($absolute) { + $this->rewriteToAbsoluteUrls($navigation); + } + return new JSONResponse($navigation); } /** * @NoAdminRequired * @NoCSRFRequired * + * @param bool $absolute * @return JSONResponse */ - public function getSettingsNavigation($absolute = false) { - return new JSONResponse($this->navigationManager->getAll('settings', $absolute)); + public function getSettingsNavigation(bool $absolute = false) { + $navigation = $this->navigationManager->getAll('settings'); + if ($absolute) { + $this->rewriteToAbsoluteUrls($navigation); + } + return new JSONResponse($navigation); + } + + /** + * Rewrite href attribute of navigation entries to an absolute URL + * + * @param array $navigation + */ + private function rewriteToAbsoluteUrls(array &$navigation) { + foreach ($navigation as &$entry) { + if (substr($entry['href'], 0, strlen($this->urlGenerator->getBaseUrl())) !== $this->urlGenerator->getBaseUrl()) { + $entry['href'] = $this->urlGenerator->getAbsoluteURL($entry['href']); + } + } } } diff --git a/tests/Core/Controller/NavigationControllerTest.php b/tests/Core/Controller/NavigationControllerTest.php index 1e9acccb615..3a745b48678 100644 --- a/tests/Core/Controller/NavigationControllerTest.php +++ b/tests/Core/Controller/NavigationControllerTest.php @@ -26,6 +26,7 @@ use OC\Core\Controller\NavigationController; use OCP\AppFramework\Http\JSONResponse; use OCP\INavigationManager; use OCP\IRequest; +use OCP\IURLGenerator; use Test\TestCase; class NavigationControllerTest extends TestCase { @@ -36,20 +37,24 @@ class NavigationControllerTest extends TestCase { /** @var INavigationManager|\PHPUnit_Framework_MockObject_MockObject */ private $navigationManager; + /** @var IURLGenerator|\PHPUnit_Framework_MockObject_MockObject */ + private $urlGenerator; + /** @var NavigationController */ private $controller; public function setUp() { parent::setUp(); - $this->request = $this->createMock(IRequest::class); $this->navigationManager = $this->createMock(INavigationManager::class); + $this->urlGenerator = $this->createMock(IURLGenerator::class); $this->controller = new NavigationController( 'core', $this->request, - $this->navigationManager + $this->navigationManager, + $this->urlGenerator ); } @@ -62,16 +67,48 @@ class NavigationControllerTest extends TestCase { public function testGetAppNavigation($absolute) { $this->navigationManager->expects($this->once()) ->method('getAll') - ->with('link', $absolute); - $this->assertInstanceOf(JSONResponse::class, $this->controller->getAppsNavigation($absolute)); + ->with('link') + ->willReturn([ ['id' => 'files', 'href' => '/index.php/apps/files'] ]); + if ($absolute) { + $this->urlGenerator->expects($this->any()) + ->method('getBaseURL') + ->willReturn('http://localhost/'); + $this->urlGenerator->expects($this->once()) + ->method('getAbsoluteURL') + ->with('/index.php/apps/files') + ->willReturn('http://localhost/index.php/apps/files'); + $actual = $this->controller->getAppsNavigation($absolute); + $this->assertInstanceOf(JSONResponse::class, $actual); + $this->assertEquals('http://localhost/index.php/apps/files', $actual->getData()[0]['href']); + } else { + $actual = $this->controller->getAppsNavigation($absolute); + $this->assertInstanceOf(JSONResponse::class, $actual); + $this->assertEquals('/index.php/apps/files', $actual->getData()[0]['href']); + } } /** @dataProvider dataGetNavigation */ public function testGetSettingsNavigation($absolute) { $this->navigationManager->expects($this->once()) ->method('getAll') - ->with('settings', $absolute); - $this->assertInstanceOf(JSONResponse::class, $this->controller->getSettingsNavigation($absolute)); + ->with('settings') + ->willReturn([ ['id' => 'settings', 'href' => '/index.php/settings/user'] ]); + if ($absolute) { + $this->urlGenerator->expects($this->any()) + ->method('getBaseURL') + ->willReturn('http://localhost/'); + $this->urlGenerator->expects($this->once()) + ->method('getAbsoluteURL') + ->with('/index.php/settings/user') + ->willReturn('http://localhost/index.php/settings/user'); + $actual = $this->controller->getSettingsNavigation($absolute); + $this->assertInstanceOf(JSONResponse::class, $actual); + $this->assertEquals('http://localhost/index.php/settings/user', $actual->getData()[0]['href']); + } else { + $actual = $this->controller->getSettingsNavigation($absolute); + $this->assertInstanceOf(JSONResponse::class, $actual); + $this->assertEquals('/index.php/settings/user', $actual->getData()[0]['href']); + } } } -- cgit v1.2.3 From 922cf44c81770a28c1e4791e9559a101d2263de9 Mon Sep 17 00:00:00 2001 From: Julius Härtl Date: Thu, 1 Feb 2018 12:18:24 +0100 Subject: Move to OCS endpoint MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- core/Controller/NavigationController.php | 30 ++++++++++++---------- core/routes.php | 4 +-- tests/Core/Controller/NavigationControllerTest.php | 10 ++++---- 3 files changed, 23 insertions(+), 21 deletions(-) (limited to 'tests') diff --git a/core/Controller/NavigationController.php b/core/Controller/NavigationController.php index 98744171198..92f103c3a34 100644 --- a/core/Controller/NavigationController.php +++ b/core/Controller/NavigationController.php @@ -22,13 +22,13 @@ */ namespace OC\Core\Controller; -use OCP\AppFramework\Controller; -use OCP\AppFramework\Http\JSONResponse; +use OCP\AppFramework\Http\DataResponse; +use OCP\AppFramework\OCSController; use OCP\INavigationManager; use OCP\IRequest; use OCP\IURLGenerator; -class NavigationController extends Controller { +class NavigationController extends OCSController { /** @var INavigationManager */ private $navigationManager; @@ -47,14 +47,14 @@ class NavigationController extends Controller { * @NoCSRFRequired * * @param bool $absolute - * @return JSONResponse + * @return DataResponse */ - public function getAppsNavigation(bool $absolute = false) { - $navigation = $this->navigationManager->getAll('link'); + public function getAppsNavigation(bool $absolute = false): DataResponse { + $navigation = $this->navigationManager->getAll(); if ($absolute) { - $this->rewriteToAbsoluteUrls($navigation); + $navigation = $this->rewriteToAbsoluteUrls($navigation); } - return new JSONResponse($navigation); + return new DataResponse($navigation); } /** @@ -62,26 +62,28 @@ class NavigationController extends Controller { * @NoCSRFRequired * * @param bool $absolute - * @return JSONResponse + * @return DataResponse */ - public function getSettingsNavigation(bool $absolute = false) { + public function getSettingsNavigation(bool $absolute = false): DataResponse { $navigation = $this->navigationManager->getAll('settings'); if ($absolute) { - $this->rewriteToAbsoluteUrls($navigation); + $navigation = $this->rewriteToAbsoluteUrls($navigation); } - return new JSONResponse($navigation); + return new DataResponse($navigation); } /** * Rewrite href attribute of navigation entries to an absolute URL * * @param array $navigation + * @return array */ - private function rewriteToAbsoluteUrls(array &$navigation) { + private function rewriteToAbsoluteUrls(array $navigation): array { foreach ($navigation as &$entry) { - if (substr($entry['href'], 0, strlen($this->urlGenerator->getBaseUrl())) !== $this->urlGenerator->getBaseUrl()) { + if (0 !== strpos($entry['href'], $this->urlGenerator->getBaseUrl())) { $entry['href'] = $this->urlGenerator->getAbsoluteURL($entry['href']); } } + return $navigation; } } diff --git a/core/routes.php b/core/routes.php index 5fc58cbdfc0..97a8621fc39 100644 --- a/core/routes.php +++ b/core/routes.php @@ -59,8 +59,6 @@ $application->registerRoutes($this, [ ['name' => 'OCJS#getConfig', 'url' => '/core/js/oc.js', 'verb' => 'GET'], ['name' => 'Preview#getPreviewByFileId', 'url' => '/core/preview', 'verb' => 'GET'], ['name' => 'Preview#getPreview', 'url' => '/core/preview.png', 'verb' => 'GET'], - ['name' => 'Navigation#getAppsNavigation', 'url' => '/core/navigation/apps', 'verb' => 'GET'], - ['name' => 'Navigation#getSettingsNavigation', 'url' => '/core/navigation/settings', 'verb' => 'GET'], ['name' => 'Css#getCss', 'url' => '/css/{appName}/{fileName}', 'verb' => 'GET'], ['name' => 'Js#getJs', 'url' => '/js/{appName}/{fileName}', 'verb' => 'GET'], ['name' => 'contactsMenu#index', 'url' => '/contactsmenu/contacts', 'verb' => 'POST'], @@ -73,6 +71,8 @@ $application->registerRoutes($this, [ ['root' => '', 'name' => 'OCS#getConfig', 'url' => '/config', 'verb' => 'GET'], ['root' => '/person', 'name' => 'OCS#personCheck', 'url' => '/check', 'verb' => 'POST'], ['root' => '/identityproof', 'name' => 'OCS#getIdentityProof', 'url' => '/key/{cloudId}', 'verb' => 'GET'], + ['root' => '/core', 'name' => 'Navigation#getAppsNavigation', 'url' => '/navigation/apps', 'verb' => 'GET'], + ['root' => '/core', 'name' => 'Navigation#getSettingsNavigation', 'url' => '/navigation/settings', 'verb' => 'GET'], ], ]); diff --git a/tests/Core/Controller/NavigationControllerTest.php b/tests/Core/Controller/NavigationControllerTest.php index 3a745b48678..9b1d33ab868 100644 --- a/tests/Core/Controller/NavigationControllerTest.php +++ b/tests/Core/Controller/NavigationControllerTest.php @@ -23,7 +23,7 @@ namespace Tests\Core\Controller; use OC\Core\Controller\NavigationController; -use OCP\AppFramework\Http\JSONResponse; +use OCP\AppFramework\Http\DataResponse; use OCP\INavigationManager; use OCP\IRequest; use OCP\IURLGenerator; @@ -78,11 +78,11 @@ class NavigationControllerTest extends TestCase { ->with('/index.php/apps/files') ->willReturn('http://localhost/index.php/apps/files'); $actual = $this->controller->getAppsNavigation($absolute); - $this->assertInstanceOf(JSONResponse::class, $actual); + $this->assertInstanceOf(DataResponse::class, $actual); $this->assertEquals('http://localhost/index.php/apps/files', $actual->getData()[0]['href']); } else { $actual = $this->controller->getAppsNavigation($absolute); - $this->assertInstanceOf(JSONResponse::class, $actual); + $this->assertInstanceOf(DataResponse::class, $actual); $this->assertEquals('/index.php/apps/files', $actual->getData()[0]['href']); } } @@ -102,11 +102,11 @@ class NavigationControllerTest extends TestCase { ->with('/index.php/settings/user') ->willReturn('http://localhost/index.php/settings/user'); $actual = $this->controller->getSettingsNavigation($absolute); - $this->assertInstanceOf(JSONResponse::class, $actual); + $this->assertInstanceOf(DataResponse::class, $actual); $this->assertEquals('http://localhost/index.php/settings/user', $actual->getData()[0]['href']); } else { $actual = $this->controller->getSettingsNavigation($absolute); - $this->assertInstanceOf(JSONResponse::class, $actual); + $this->assertInstanceOf(DataResponse::class, $actual); $this->assertEquals('/index.php/settings/user', $actual->getData()[0]['href']); } } -- cgit v1.2.3 From 5a23b35ddbbefcb308915e3fb088e3beaf1f8be5 Mon Sep 17 00:00:00 2001 From: Julius Härtl Date: Mon, 12 Feb 2018 17:30:08 +0100 Subject: Also rewrite icon url MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- core/Controller/NavigationController.php | 3 +++ tests/Core/Controller/NavigationControllerTest.php | 23 ++++++++++++++++++---- 2 files changed, 22 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/core/Controller/NavigationController.php b/core/Controller/NavigationController.php index 92f103c3a34..3521fac3b46 100644 --- a/core/Controller/NavigationController.php +++ b/core/Controller/NavigationController.php @@ -83,6 +83,9 @@ class NavigationController extends OCSController { if (0 !== strpos($entry['href'], $this->urlGenerator->getBaseUrl())) { $entry['href'] = $this->urlGenerator->getAbsoluteURL($entry['href']); } + if (0 !== strpos($entry['icon'], $this->urlGenerator->getBaseUrl())) { + $entry['icon'] = $this->urlGenerator->getAbsoluteURL($entry['icon']); + } } return $navigation; } diff --git a/tests/Core/Controller/NavigationControllerTest.php b/tests/Core/Controller/NavigationControllerTest.php index 9b1d33ab868..1143ed003f0 100644 --- a/tests/Core/Controller/NavigationControllerTest.php +++ b/tests/Core/Controller/NavigationControllerTest.php @@ -68,22 +68,31 @@ class NavigationControllerTest extends TestCase { $this->navigationManager->expects($this->once()) ->method('getAll') ->with('link') - ->willReturn([ ['id' => 'files', 'href' => '/index.php/apps/files'] ]); + ->willReturn([ ['id' => 'files', 'href' => '/index.php/apps/files', 'icon' => 'icon' ] ]); if ($absolute) { $this->urlGenerator->expects($this->any()) ->method('getBaseURL') ->willReturn('http://localhost/'); - $this->urlGenerator->expects($this->once()) + $this->urlGenerator->expects($this->at(1)) ->method('getAbsoluteURL') ->with('/index.php/apps/files') ->willReturn('http://localhost/index.php/apps/files'); + $this->urlGenerator->expects($this->at(3)) + ->method('getAbsoluteURL') + ->with('icon') + ->willReturn('http://localhost/icon'); $actual = $this->controller->getAppsNavigation($absolute); $this->assertInstanceOf(DataResponse::class, $actual); $this->assertEquals('http://localhost/index.php/apps/files', $actual->getData()[0]['href']); + $this->assertEquals('http://localhost/icon', $actual->getData()[0]['icon']); + + } else { $actual = $this->controller->getAppsNavigation($absolute); $this->assertInstanceOf(DataResponse::class, $actual); $this->assertEquals('/index.php/apps/files', $actual->getData()[0]['href']); + $this->assertEquals('icon', $actual->getData()[0]['icon']); + } } @@ -92,22 +101,28 @@ class NavigationControllerTest extends TestCase { $this->navigationManager->expects($this->once()) ->method('getAll') ->with('settings') - ->willReturn([ ['id' => 'settings', 'href' => '/index.php/settings/user'] ]); + ->willReturn([ ['id' => 'settings', 'href' => '/index.php/settings/user', 'icon' => '/core/img/settings.svg'] ]); if ($absolute) { $this->urlGenerator->expects($this->any()) ->method('getBaseURL') ->willReturn('http://localhost/'); - $this->urlGenerator->expects($this->once()) + $this->urlGenerator->expects($this->at(1)) ->method('getAbsoluteURL') ->with('/index.php/settings/user') ->willReturn('http://localhost/index.php/settings/user'); + $this->urlGenerator->expects($this->at(3)) + ->method('getAbsoluteURL') + ->with('/core/img/settings.svg') + ->willReturn('http://localhost/core/img/settings.svg'); $actual = $this->controller->getSettingsNavigation($absolute); $this->assertInstanceOf(DataResponse::class, $actual); $this->assertEquals('http://localhost/index.php/settings/user', $actual->getData()[0]['href']); + $this->assertEquals('http://localhost/core/img/settings.svg', $actual->getData()[0]['icon']); } else { $actual = $this->controller->getSettingsNavigation($absolute); $this->assertInstanceOf(DataResponse::class, $actual); $this->assertEquals('/index.php/settings/user', $actual->getData()[0]['href']); + $this->assertEquals('/core/img/settings.svg', $actual->getData()[0]['icon']); } } -- cgit v1.2.3