diff --git a/core/Test/VersionUpdateControllerTest.php b/core/Test/VersionUpdateControllerTest.php new file mode 100644 index 0000000000000000000000000000000000000000..c691e07c74df34cc11d87f68b58d172482265f77 --- /dev/null +++ b/core/Test/VersionUpdateControllerTest.php @@ -0,0 +1,30 @@ +<?php + +/** + * Copyright Maarch since 2008 under licence GPLv3. + * See LICENCE.txt file at the root folder for more details. + * This file is part of Maarch software. + * + */ + +use PHPUnit\Framework\TestCase; + +class VersionUpdateControllerTest extends TestCase +{ + public function testGet() + { + $versionUpdateController = new \VersionUpdate\controllers\VersionUpdateController(); + + // GET + $environment = \Slim\Http\Environment::mock(['REQUEST_METHOD' => 'GET']); + $request = \Slim\Http\Request::createFromEnvironment($environment); + $response = $versionUpdateController->get($request, new \Slim\Http\Response()); + $responseBody = json_decode((string)$response->getBody()); + + $this->assertInternalType('array', $responseBody->currentMinorVersions); + $this->assertNotNull($responseBody->currentMinorVersions); + $this->assertInternalType('array', $responseBody->availableMajorVersions); + $this->assertInternalType('string', $responseBody->currentVersion); + $this->assertNotNull($responseBody->currentVersion); + } +} diff --git a/phpunit.xml b/phpunit.xml index 4f76811ca0c752f7a3993d0a38b2a19e1c4dd4d1..9c913044911fea90c0d6ce25727f375d9ca2c7d2 100755 --- a/phpunit.xml +++ b/phpunit.xml @@ -7,6 +7,7 @@ <file>core/Test/AutocompleteControllerTest.php</file> <file>core/Test/BasketControllerTest.php</file> <file>core/Test/ContactControllerTest.php</file> + <file>core/Test/ContactGroupControllerTest.php</file> <file>core/Test/DoctypeControllerTest.php</file> <file>core/Test/EntityControllerTest.php</file> <file>core/Test/GroupControllerTest.php</file> @@ -19,6 +20,7 @@ <file>core/Test/ResControllerTest.php</file> <file>core/Test/StatusControllerTest.php</file> <file>core/Test/UserControllerTest.php</file> + <file>core/Test/VersionUpdateControllerTest.php</file> <!--<file>modules/convert/Test/ProcessConvertTest.php</file>--> <!--<file>modules/convert/Test/ProcessFulltextTest.php</file>--> <!--<file>modules/convert/Test/ProcessManageConvertTest.php</file>-->