36 lines
875 B
PHP
36 lines
875 B
PHP
<?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\Entity\User;
|
|
|
|
/**
|
|
* @coversDefaultClass \App\API\HealthcheckController
|
|
* @group integration
|
|
* @group legacy
|
|
*/
|
|
class HealthcheckControllerTest extends APIControllerBaseTest
|
|
{
|
|
public function testIsSecure()
|
|
{
|
|
$this->assertUrlIsSecured('/api/ping');
|
|
}
|
|
|
|
public function testPing()
|
|
{
|
|
$client = $this->getClientForAuthenticatedUser(User::ROLE_USER);
|
|
$this->assertAccessIsGranted($client, '/api/ping');
|
|
$result = json_decode($client->getResponse()->getContent(), true);
|
|
|
|
$this->assertInternalType('array', $result);
|
|
$this->assertEquals(['message' => 'pong'], $result);
|
|
}
|
|
}
|