prepare release 1.14 (#2495)
* removed un-maintained docker file * update all packages * fix deprecations * only show one line descriptions for customer, projects and activities * allow to show export column in timesheet listing
This commit is contained in:
@@ -60,21 +60,8 @@ abstract class APIControllerBaseTest extends ControllerBaseTest
|
||||
return $client;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $url
|
||||
* @param bool $json
|
||||
* @return string
|
||||
*/
|
||||
protected function createUrl($url, $json = true)
|
||||
protected function createUrl(string $url): string
|
||||
{
|
||||
if ($json) {
|
||||
if (stripos($url, '?') !== false) {
|
||||
$url = str_replace('?', '.json?', $url);
|
||||
} else {
|
||||
$url .= '.json';
|
||||
}
|
||||
}
|
||||
|
||||
return '/' . ltrim($url, '/');
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ class ApiDocControllerTest extends ControllerBaseTest
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_USER);
|
||||
$this->assertAccessIsGranted($client, '/api/doc');
|
||||
$this->assertStringContainsString('<title>Kimai 2 - API Docs</title>', $client->getResponse()->getContent());
|
||||
$this->assertStringContainsString('<title>Kimai - API Docs</title>', $client->getResponse()->getContent());
|
||||
$result = $client->getCrawler()->filter('script#swagger-data');
|
||||
$swaggerJson = json_decode($result->text(), true);
|
||||
$tags = [];
|
||||
@@ -51,17 +51,13 @@ class ApiDocControllerTest extends ControllerBaseTest
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_USER);
|
||||
$this->assertAccessIsGranted($client, '/api/doc.json');
|
||||
$this->assertStringContainsString('"title":"Kimai 2 - API Docs"', $client->getResponse()->getContent());
|
||||
$this->assertStringContainsString('"title":"Kimai - API Docs"', $client->getResponse()->getContent());
|
||||
$result = json_decode($client->getResponse()->getContent(), true);
|
||||
$this->assertIsArray($result);
|
||||
$this->assertNotEmpty($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $url
|
||||
* @return string
|
||||
*/
|
||||
protected function createUrl($url)
|
||||
protected function createUrl(string $url): string
|
||||
{
|
||||
return '/' . ltrim($url, '/');
|
||||
}
|
||||
|
||||
26
tests/API/NotFoundExceptionTest.php
Normal file
26
tests/API/NotFoundExceptionTest.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Kimai time-tracking app.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace App\Tests\API;
|
||||
|
||||
use App\API\NotFoundException;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* @covers \App\API\NotFoundException
|
||||
*/
|
||||
class NotFoundExceptionTest extends TestCase
|
||||
{
|
||||
public function testConstructor()
|
||||
{
|
||||
$sut = new NotFoundException();
|
||||
self::assertEquals('Not found', $sut->getMessage());
|
||||
self::assertEquals(404, $sut->getCode());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user