Release 2.18 (#4878)
This commit is contained in:
@@ -25,7 +25,9 @@ class ConfigurationControllerTest extends APIControllerBaseTest
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_USER);
|
||||
$this->assertAccessIsGranted($client, '/api/config/timesheet', 'GET');
|
||||
$result = json_decode($client->getResponse()->getContent(), true);
|
||||
$content = $client->getResponse()->getContent();
|
||||
$this->assertIsString($content);
|
||||
$result = json_decode($content, true);
|
||||
|
||||
$this->assertIsArray($result);
|
||||
$this->assertNotEmpty($result);
|
||||
@@ -37,4 +39,53 @@ class ConfigurationControllerTest extends APIControllerBaseTest
|
||||
|
||||
$this->assertEquals($expectedKeys, $actual, 'Config structure does not match');
|
||||
}
|
||||
|
||||
public function testIsColorsSecure(): void
|
||||
{
|
||||
$this->assertUrlIsSecured('/api/config/colors');
|
||||
}
|
||||
|
||||
public function testGetColors(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_USER);
|
||||
$this->assertAccessIsGranted($client, '/api/config/colors', 'GET');
|
||||
$content = $client->getResponse()->getContent();
|
||||
$this->assertIsString($content);
|
||||
$actual = json_decode($content, true);
|
||||
|
||||
$this->assertIsArray($actual);
|
||||
$this->assertNotEmpty($actual);
|
||||
$expected = [
|
||||
'Silver' => '#c0c0c0',
|
||||
'Gray' => '#808080',
|
||||
'Black' => '#000000',
|
||||
'Maroon' => '#800000',
|
||||
'Brown' => '#a52a2a',
|
||||
'Red' => '#ff0000',
|
||||
'Orange' => '#ffa500',
|
||||
'Gold' => '#ffd700',
|
||||
'Yellow' => '#ffff00',
|
||||
'Peach' => '#ffdab9',
|
||||
'Khaki' => '#f0e68c',
|
||||
'Olive' => '#808000',
|
||||
'Lime' => '#00ff00',
|
||||
'Jelly' => '#9acd32',
|
||||
'Green' => '#008000',
|
||||
'Teal' => '#008080',
|
||||
'Aqua' => '#00ffff',
|
||||
'LightBlue' => '#add8e6',
|
||||
'DeepSky' => '#00bfff',
|
||||
'Dodger' => '#1e90ff',
|
||||
'Blue' => '#0000ff',
|
||||
'Navy' => '#000080',
|
||||
'Purple' => '#800080',
|
||||
'Fuchsia' => '#ff00ff',
|
||||
'Violet' => '#ee82ee',
|
||||
'Rose' => '#ffe4e1',
|
||||
'Lavender' => '#E6E6FA',
|
||||
];
|
||||
$this->assertCount(\count($expected), $actual);
|
||||
|
||||
$this->assertEquals($expected, $actual, 'Color structure does not match');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user