User profile layout (#2402)
This commit is contained in:
@@ -74,7 +74,7 @@ class ProfileControllerTest extends ControllerBaseTest
|
||||
|
||||
protected function assertHasProfileBox(HttpKernelBrowser $client, string $username)
|
||||
{
|
||||
$profileBox = $client->getCrawler()->filter('div.box-body.box-profile');
|
||||
$profileBox = $client->getCrawler()->filter('div.box-user-profile');
|
||||
$this->assertEquals(1, $profileBox->count());
|
||||
$profileAvatar = $profileBox->filter('img.img-circle');
|
||||
$this->assertEquals(1, $profileAvatar->count());
|
||||
@@ -87,8 +87,7 @@ class ProfileControllerTest extends ControllerBaseTest
|
||||
{
|
||||
$content = $client->getResponse()->getContent();
|
||||
|
||||
$this->assertStringContainsString('<h3 class="box-title">About me</h3>', $content);
|
||||
$this->assertStringContainsString('<td class="text-nowrap pull-right">' . $username . '</td>', $content);
|
||||
$this->assertStringContainsString('About me', $content);
|
||||
}
|
||||
|
||||
public function getTabTestData()
|
||||
|
||||
@@ -153,7 +153,7 @@ class AppExtensionTest extends TestCase
|
||||
],
|
||||
'kimai.theme' => [
|
||||
'active_warning' => 3,
|
||||
'box_color' => 'green',
|
||||
'box_color' => 'blue',
|
||||
'select_type' => 'selectpicker',
|
||||
'show_about' => true,
|
||||
'chart' => [
|
||||
|
||||
@@ -340,7 +340,7 @@ class ConfigurationTest extends TestCase
|
||||
],
|
||||
'theme' => [
|
||||
'active_warning' => 3,
|
||||
'box_color' => 'green',
|
||||
'box_color' => 'blue',
|
||||
'select_type' => 'selectpicker',
|
||||
'auto_reload_datatable' => false,
|
||||
'show_about' => true,
|
||||
|
||||
44
tests/Event/PageActionsEventTest.php
Normal file
44
tests/Event/PageActionsEventTest.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?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\Event;
|
||||
|
||||
use App\Entity\User;
|
||||
use App\Event\PageActionsEvent;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* @covers \App\Event\PageActionsEvent
|
||||
*/
|
||||
class PageActionsEventTest extends TestCase
|
||||
{
|
||||
public function testDefaultValues()
|
||||
{
|
||||
$user = new User();
|
||||
$user->setAlias('foo');
|
||||
|
||||
$sut = new PageActionsEvent($user, [], 'foo');
|
||||
$this->assertSame($user, $sut->getUser());
|
||||
$this->assertEquals([], $sut->getActions());
|
||||
$this->assertEquals(['actions' => []], $sut->getPayload());
|
||||
|
||||
$sut = new PageActionsEvent($user, ['hello' => 'world'], 'foo');
|
||||
$this->assertSame($user, $sut->getUser());
|
||||
$this->assertEquals([], $sut->getActions());
|
||||
$this->assertEquals(['hello' => 'world', 'actions' => []], $sut->getPayload());
|
||||
}
|
||||
|
||||
public function testSetActions()
|
||||
{
|
||||
$sut = new PageActionsEvent(new User(), ['hello' => 'world'], 'foo');
|
||||
$sut->setActions(['foo' => ['url' => 'bar']]);
|
||||
$this->assertEquals(['foo' => ['url' => 'bar']], $sut->getActions());
|
||||
$this->assertEquals(['hello' => 'world', 'actions' => ['foo' => ['url' => 'bar']]], $sut->getPayload());
|
||||
}
|
||||
}
|
||||
@@ -18,6 +18,14 @@ use PHPUnit\Framework\TestCase;
|
||||
*/
|
||||
class ThemeEventTest extends TestCase
|
||||
{
|
||||
public function testEmpty()
|
||||
{
|
||||
$sut = new ThemeEvent();
|
||||
$this->assertNull($sut->getUser());
|
||||
$this->assertNull($sut->getPayload());
|
||||
$this->assertEquals('', $sut->getContent());
|
||||
}
|
||||
|
||||
public function testDefaultValues()
|
||||
{
|
||||
$user = new User();
|
||||
@@ -25,21 +33,7 @@ class ThemeEventTest extends TestCase
|
||||
|
||||
$sut = new ThemeEvent($user);
|
||||
|
||||
$this->assertNull($sut->getPayload());
|
||||
$this->assertEquals('', $sut->getContent());
|
||||
}
|
||||
|
||||
/**
|
||||
* @group legacy
|
||||
*/
|
||||
public function testDeprecation()
|
||||
{
|
||||
$user = new User();
|
||||
$user->setAlias('foo');
|
||||
|
||||
$sut = new ThemeEvent($user);
|
||||
|
||||
$this->assertEquals($user, $sut->getUser());
|
||||
$this->assertSame($user, $sut->getUser());
|
||||
}
|
||||
|
||||
public function testGetterAndSetter()
|
||||
|
||||
@@ -37,7 +37,7 @@ class RuntimeExtensionsTest extends TestCase
|
||||
|
||||
public function testGetFunctions()
|
||||
{
|
||||
$expected = ['trigger', 'javascript_translations', 'timesheet_exporter', 'active_timesheets', 'encore_entry_css_source', 'render_widget'];
|
||||
$expected = ['trigger', 'actions', 'javascript_translations', 'timesheet_exporter', 'active_timesheets', 'encore_entry_css_source', 'render_widget'];
|
||||
$i = 0;
|
||||
|
||||
$sut = new RuntimeExtensions();
|
||||
|
||||
Reference in New Issue
Block a user