Release 2.5.0 (#4454)
- added command to list users - corrected wrong german translation - work contract validations - prevent error with missing params - use collapsible, minor UI improvement - added classes to target menu buttons in custom rules - disable webpack notifier, incompatible with mac arm - use explicit menu service to generate menu - bump to fontawesome 6 and replace restart icon - change repeat icon for recent activities - moved user bookmarks (favorites) to top nav - fix totp seconds window (leeway) - new migration to fix remaining user preferences with dots in name - remove duplicate named column in user screen - unify and added translations - added missing filter and tags to InvoiceSecurity
This commit is contained in:
48
tests/Command/ListUserCommandTest.php
Normal file
48
tests/Command/ListUserCommandTest.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?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\Command;
|
||||
|
||||
use App\Command\ListUserCommand;
|
||||
use App\Repository\UserRepository;
|
||||
use Symfony\Bundle\FrameworkBundle\Console\Application;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
||||
use Symfony\Component\Console\Tester\CommandTester;
|
||||
|
||||
/**
|
||||
* @covers \App\Command\ListUserCommand
|
||||
* @group integration
|
||||
*/
|
||||
class ListUserCommandTest extends KernelTestCase
|
||||
{
|
||||
public function testWithPlugins(): void
|
||||
{
|
||||
$commandTester = $this->getCommandTester();
|
||||
$output = $commandTester->getDisplay();
|
||||
$this->assertStringContainsString('Username Email Roles Active PW Reset', $output);
|
||||
$this->assertStringContainsString('---------- ------- ------- -------- ----------', $output);
|
||||
}
|
||||
|
||||
protected function getCommandTester(): CommandTester
|
||||
{
|
||||
$repository = $this->createMock(UserRepository::class);
|
||||
$repository->method('findAll')->willReturn([]);
|
||||
|
||||
$kernel = self::bootKernel();
|
||||
$application = new Application($kernel);
|
||||
$application->add(new ListUserCommand($repository));
|
||||
|
||||
$command = $application->find('kimai:user:list');
|
||||
$commandTester = new CommandTester($command);
|
||||
$inputs = array_merge(['command' => $command->getName()], []);
|
||||
$commandTester->execute($inputs);
|
||||
|
||||
return $commandTester;
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
<?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\EventSubscriber;
|
||||
|
||||
use App\Event\ConfigureMainMenuEvent;
|
||||
use App\EventSubscriber\MenuFavoritesSubscriber;
|
||||
use App\EventSubscriber\MenuSubscriber;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* @covers \App\EventSubscriber\MenuFavoritesSubscriber
|
||||
*/
|
||||
class MenuFavoritesSubscriberTest extends TestCase
|
||||
{
|
||||
public function testGetSubscribedEvents(): void
|
||||
{
|
||||
$events = MenuFavoritesSubscriber::getSubscribedEvents();
|
||||
$this->assertArrayHasKey(ConfigureMainMenuEvent::class, $events);
|
||||
$methodName = $events[ConfigureMainMenuEvent::class][0];
|
||||
self::assertIsString($methodName);
|
||||
$this->assertTrue(method_exists(MenuSubscriber::class, $methodName));
|
||||
}
|
||||
}
|
||||
@@ -49,7 +49,6 @@ abstract class BaseFormTypeQueryTest extends TestCase
|
||||
$team = new Team('foo');
|
||||
self::assertInstanceOf(BaseFormTypeQuery::class, $sut->addTeam($team));
|
||||
self::assertCount(1, $sut->getTeams());
|
||||
/* @phpstan-ignore-next-line */
|
||||
self::assertSame($team, $sut->getTeams()[0]);
|
||||
|
||||
$sut->setTeams([]);
|
||||
|
||||
@@ -108,8 +108,7 @@ class BaseQueryTest extends TestCase
|
||||
|
||||
$team = new Team('foo');
|
||||
self::assertInstanceOf(BaseQuery::class, $sut->setTeams([$team]));
|
||||
self::assertEquals(1, \count($sut->getTeams()));
|
||||
/* @phpstan-ignore-next-line */
|
||||
self::assertCount(1, $sut->getTeams());
|
||||
self::assertSame($team, $sut->getTeams()[0]);
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ use Twig\TwigFunction;
|
||||
*/
|
||||
class RuntimeExtensionsTest extends TestCase
|
||||
{
|
||||
public function testGetFilters()
|
||||
public function testGetFilters(): void
|
||||
{
|
||||
$expected = ['md2html', 'desc2html', 'comment2html', 'comment1line', 'colorize', 'icon'];
|
||||
$i = 0;
|
||||
@@ -35,7 +35,7 @@ class RuntimeExtensionsTest extends TestCase
|
||||
}
|
||||
}
|
||||
|
||||
public function testGetFunctions()
|
||||
public function testGetFunctions(): void
|
||||
{
|
||||
$expected = [
|
||||
'trigger',
|
||||
@@ -50,6 +50,7 @@ class RuntimeExtensionsTest extends TestCase
|
||||
'render_widget',
|
||||
'icon',
|
||||
'qr_code_data_uri',
|
||||
'user_shortcuts',
|
||||
];
|
||||
|
||||
$i = 0;
|
||||
@@ -65,7 +66,7 @@ class RuntimeExtensionsTest extends TestCase
|
||||
}
|
||||
}
|
||||
|
||||
public function testGetFilterDefinition()
|
||||
public function testGetFilterDefinition(): void
|
||||
{
|
||||
$sut = new RuntimeExtensions();
|
||||
$filters = $sut->getFilters();
|
||||
|
||||
@@ -8852,21 +8852,6 @@ parameters:
|
||||
count: 1
|
||||
path: Twig/Runtime/WidgetExtensionTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\Twig\\\\RuntimeExtensionsTest\\:\\:testGetFilterDefinition\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: Twig/RuntimeExtensionsTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\Twig\\\\RuntimeExtensionsTest\\:\\:testGetFilters\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: Twig/RuntimeExtensionsTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\Twig\\\\RuntimeExtensionsTest\\:\\:testGetFunctions\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: Twig/RuntimeExtensionsTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\Utils\\\\ColorTest\\:\\:assertIsValidColor\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
|
||||
Reference in New Issue
Block a user