Files
kimai2/tests/Controller/HelpControllerTest.php
Simon Schaufelberger 93e1cd5095 Secure create-user command #123 (#127)
* ask the user for the password #123
* added integration test #123
2018-02-10 19:11:30 +01:00

48 lines
1.4 KiB
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\Controller;
/**
* @coversDefaultClass \App\Controller\HelpController
* @group integration
*/
class HelpControllerTest extends ControllerBaseTest
{
public function testIsSecure()
{
$this->assertUrlIsSecured('/help/');
}
public function testReadmePage()
{
$client = $this->getClientForAuthenticatedUser();
$this->request($client, '/help/');
$this->assertTrue($client->getResponse()->isSuccessful());
$this->assertContains('<h1>Kimai documentation</h1>', $client->getResponse()->getContent());
$this->assertNotContains('<a href="/en/help/">', $client->getResponse()->getContent());
}
public function testUsersPage()
{
$client = $this->getClientForAuthenticatedUser();
$this->request($client, '/help/users');
$this->assertTrue($client->getResponse()->isSuccessful());
$this->assertContains('<a href="/en/help/">', $client->getResponse()->getContent());
}
public function testValidateRouteDoesNotAllowSpecialChars()
{
$client = $this->getClientForAuthenticatedUser();
$this->request($client, '/help/.users');
$this->assertRouteNotFound($client);
}
}