diff --git a/server/tests/Action/DownloadFileActionTest.php b/server/tests/Action/DownloadFileActionTest.php deleted file mode 100644 index a250e03e62e5e64bed43dffc6eb6bd1626a92d7a..0000000000000000000000000000000000000000 --- a/server/tests/Action/DownloadFileActionTest.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php - -/* - * This file is part of Anis Server. - * - * (c) Laboratoire d'Astrophysique de Marseille / CNRS - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -declare(strict_types=1); - -namespace App\Tests\Action; - -use PHPUnit\Framework\TestCase; -use Slim\Exception\HttpNotFoundException; -use Nyholm\Psr7\ServerRequest; -use Nyholm\Psr7\Response; -use Doctrine\ORM\EntityManager; - -final class DownloadFileActionTest extends TestCase -{ - private $action; - private $entityManager; - - protected function setUp(): void - { - $this->entityManager = $this->createMock(EntityManager::class); - $this->action = new \App\Action\DownloadFileAction($this->entityManager, '', array()); - } - - public function testOptionsHttpMethod(): void - { - $request = $this->getRequest('OPTIONS'); - $response = ($this->action)($request, new Response(), array()); - $this->assertSame($response->getHeaderLine('Access-Control-Allow-Methods'), 'GET, OPTIONS'); - } - - public function testDatasetIsNotFound(): void - { - $this->expectException(HttpNotFoundException::class); - $this->expectExceptionMessage('Dataset with name obs_cat is not found'); - $request = $this->getRequest('GET'); - $response = ($this->action)($request, new Response(), array('dname' => 'obs_cat')); - $this->assertEquals(404, (int) $response->getStatusCode()); - } - - private function getRequest(string $method): ServerRequest - { - return new ServerRequest($method, '/download-file/obs_cat/file.fits', array( - 'Content-Type' => 'application/json' - )); - } -} diff --git a/server/tests/Action/InstanceActionTest.php b/server/tests/Action/InstanceActionTest.php index 1340c77e2af287802960228326c9de79703e7d73..60645f6a7cb15520aae64404c53f2ff96615e7f1 100644 --- a/server/tests/Action/InstanceActionTest.php +++ b/server/tests/Action/InstanceActionTest.php @@ -92,6 +92,7 @@ final class InstanceActionTest extends TestCase 'home_component' => 'WelcomeComponent', 'home_component_config' => '{}', 'samp_enabled' => true, + 'back_to_portal' => true, 'search_by_criteria_allowed' => true, 'search_by_criteria_label' => 'Search', 'search_multiple_allowed' => false, diff --git a/server/tests/Action/InstanceListActionTest.php b/server/tests/Action/InstanceListActionTest.php index 2254c0b9baed0edfd386d2579c284b4b31cd3e19..5ad65130deb8c2523db59691e44137eb42cbb5fc 100644 --- a/server/tests/Action/InstanceListActionTest.php +++ b/server/tests/Action/InstanceListActionTest.php @@ -91,6 +91,7 @@ final class InstanceListActionTest extends TestCase 'home_component' => 'WelcomeComponent', 'home_component_config' => '{}', 'samp_enabled' => true, + 'back_to_portal' => true, 'search_by_criteria_allowed' => true, 'search_by_criteria_label' => 'Search', 'search_multiple_allowed' => false,