Files
kimai2/tests/Controller/HomepageControllerTest.php
Kevin Papst 25469113fd Release 2.0.2 (#3856)
* allow to overwrite global spreadsheet styles
* bump version
* fix deprecations in vcard download
* bump composer packages
* added help page for all registered locales
* fix menu id's, cleanup times route, fix configurable homepage redirect
* format duration without leading zero in hours (unify javascript with php behavior)
* fix active records in all screen sizes
* improved responsiveness in XS
* fixed invoice number for customer null fields
* fix javascript respects multiple recent-activity dropdowns
* show recent activities on small screens
* fix user-profile layout column in XS
* fix search is always marked as active
2023-02-21 19:21:49 +01:00

52 lines
1.3 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;
use App\Entity\User;
use App\Entity\UserPreference;
use App\Form\Type\InitialViewType;
/**
* @group integration
*/
class HomepageControllerTest extends ControllerBaseTest
{
public function testIsSecure()
{
$this->assertUrlIsSecured('/homepage');
}
public function testIndexAction()
{
$client = $this->getClientForAuthenticatedUser(User::ROLE_USER);
$this->request($client, '/homepage');
$this->assertIsRedirect($client, '/en/timesheet/');
}
public function testIndexActionWithChangedPreferences()
{
$client = $this->getClientForAuthenticatedUser(User::ROLE_USER);
$em = $this->getEntityManager();
$user = $this->getUserByRole(User::ROLE_USER);
$pref = (new UserPreference('login_initial_view', 'my_profile'))
->setType(InitialViewType::class);
$em->persist($pref);
$user->addPreference($pref);
$user->setLanguage('ar');
$em->flush();
$this->request($client, '/homepage');
$this->assertIsRedirect($client, '/ar/profile/');
}
}