|
|
|
@ -7,7 +7,6 @@
|
|
|
|
namespace Tests\Core\Controller;
|
|
|
|
namespace Tests\Core\Controller;
|
|
|
|
|
|
|
|
|
|
|
|
use OC\Core\Controller\NavigationController;
|
|
|
|
use OC\Core\Controller\NavigationController;
|
|
|
|
use OCP\AppFramework\Http;
|
|
|
|
|
|
|
|
use OCP\AppFramework\Http\DataResponse;
|
|
|
|
use OCP\AppFramework\Http\DataResponse;
|
|
|
|
use OCP\INavigationManager;
|
|
|
|
use OCP\INavigationManager;
|
|
|
|
use OCP\IRequest;
|
|
|
|
use OCP\IRequest;
|
|
|
|
@ -103,34 +102,4 @@ class NavigationControllerTest extends TestCase {
|
|
|
|
$this->assertEquals('/core/img/settings.svg', $actual->getData()[0]['icon']);
|
|
|
|
$this->assertEquals('/core/img/settings.svg', $actual->getData()[0]['icon']);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public function testGetAppNavigationEtagMatch(): void {
|
|
|
|
|
|
|
|
$navigation = [ ['id' => 'files', 'href' => '/index.php/apps/files', 'icon' => 'icon' ] ];
|
|
|
|
|
|
|
|
$this->request->expects($this->once())
|
|
|
|
|
|
|
|
->method('getHeader')
|
|
|
|
|
|
|
|
->with('If-None-Match')
|
|
|
|
|
|
|
|
->willReturn(md5(json_encode($navigation)));
|
|
|
|
|
|
|
|
$this->navigationManager->expects($this->once())
|
|
|
|
|
|
|
|
->method('getAll')
|
|
|
|
|
|
|
|
->with('link')
|
|
|
|
|
|
|
|
->willReturn($navigation);
|
|
|
|
|
|
|
|
$actual = $this->controller->getAppsNavigation();
|
|
|
|
|
|
|
|
$this->assertInstanceOf(DataResponse::class, $actual);
|
|
|
|
|
|
|
|
$this->assertEquals(Http::STATUS_NOT_MODIFIED, $actual->getStatus());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function testGetSettingsNavigationEtagMatch(): void {
|
|
|
|
|
|
|
|
$navigation = [ ['id' => 'logout', 'href' => '/index.php/apps/files', 'icon' => 'icon' ] ];
|
|
|
|
|
|
|
|
$this->request->expects($this->once())
|
|
|
|
|
|
|
|
->method('getHeader')
|
|
|
|
|
|
|
|
->with('If-None-Match')
|
|
|
|
|
|
|
|
->willReturn(md5(json_encode([ ['id' => 'logout', 'href' => 'logout', 'icon' => 'icon' ] ])));
|
|
|
|
|
|
|
|
$this->navigationManager->expects($this->once())
|
|
|
|
|
|
|
|
->method('getAll')
|
|
|
|
|
|
|
|
->with('settings')
|
|
|
|
|
|
|
|
->willReturn($navigation);
|
|
|
|
|
|
|
|
$actual = $this->controller->getSettingsNavigation();
|
|
|
|
|
|
|
|
$this->assertInstanceOf(DataResponse::class, $actual);
|
|
|
|
|
|
|
|
$this->assertEquals(Http::STATUS_NOT_MODIFIED, $actual->getStatus());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|