Release 2.24 (#5097)

This commit is contained in:
Kevin Papst
2024-10-11 21:56:54 +02:00
committed by GitHub
parent 5fac6a642c
commit ff9bf163ee
32 changed files with 381 additions and 463 deletions

View File

@@ -7,11 +7,10 @@
* file that was distributed with this source code.
*/
namespace API;
namespace App\Tests\API;
use App\Entity\Invoice;
use App\Entity\User;
use App\Tests\API\APIControllerBaseTest;
use App\Tests\DataFixtures\InvoiceFixtures;
/**

View File

@@ -13,6 +13,7 @@ use App\Command\ResetTestCommand;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface;
/**
* @covers \App\Command\ResetTestCommand
@@ -24,7 +25,11 @@ class ResetTestCommandTest extends KernelTestCase
{
$kernel = self::bootKernel();
$application = new Application($kernel);
$application->add(new ResetTestCommand($this->createMock(EntityManagerInterface::class), 'test'));
$application->add(new ResetTestCommand(
$this->createMock(EntityManagerInterface::class),
$this->createMock(UserPasswordHasherInterface::class),
'test'
));
self::assertTrue($application->has('kimai:reset:test'));
$command = $application->find('kimai:reset:test');
@@ -33,7 +38,11 @@ class ResetTestCommandTest extends KernelTestCase
public function testCommandNameIsNotEnabledInProd(): void
{
$sut = new ResetTestCommand($this->createMock(EntityManagerInterface::class), 'prod');
$sut = new ResetTestCommand(
$this->createMock(EntityManagerInterface::class),
$this->createMock(UserPasswordHasherInterface::class),
'prod'
);
self::assertFalse($sut->isEnabled());
}
}

View File

@@ -12,6 +12,7 @@ namespace App\Tests\Controller\Security;
use App\Configuration\SamlConfiguration;
use App\Configuration\SystemConfiguration;
use App\Controller\Security\SecurityController;
use App\DataFixtures\UserFixtures;
use App\Entity\User;
use App\Tests\Configuration\TestConfigLoader;
use App\Tests\Controller\ControllerBaseTest;
@@ -63,8 +64,8 @@ class SecurityControllerTest extends ControllerBaseTest
$form = $client->getCrawler()->filter('body form')->form();
$client->submit($form, [
'_username' => 'susan_super',
'_password' => 'kitten'
'_username' => UserFixtures::USERNAME_SUPER_ADMIN,
'_password' => UserFixtures::DEFAULT_PASSWORD
]);
$this->assertIsRedirect($client); // redirect to root URL