Release 2.20.0 (#4987)

This commit is contained in:
Kevin Papst
2024-08-04 18:22:27 +02:00
committed by GitHub
parent 0947b88d36
commit ff6a3e8262
101 changed files with 441 additions and 458 deletions

View File

@@ -182,13 +182,13 @@ abstract class ControllerBaseTest extends WebTestCase
self::assertTrue(
$response->isRedirect(),
sprintf('The secure URL %s is not protected.', $url)
\sprintf('The secure URL %s is not protected.', $url)
);
self::assertStringEndsWith(
'/login',
$response->getTargetUrl(),
sprintf('The secure URL %s does not redirect to the login form.', $url)
\sprintf('The secure URL %s does not redirect to the login form.', $url)
);
}
@@ -210,7 +210,7 @@ abstract class ControllerBaseTest extends WebTestCase
$client->request($method, $this->createUrl($url));
self::assertFalse(
$client->getResponse()->isSuccessful(),
sprintf('The secure URL %s is not protected for role %s', $url, $role)
\sprintf('The secure URL %s is not protected for role %s', $url, $role)
);
$this->assertAccessDenied($client);
}
@@ -325,7 +325,7 @@ abstract class ControllerBaseTest extends WebTestCase
self::assertEquals(
\count($fieldNames),
\count($validationErrors),
sprintf('Expected %s validation errors, found %s', \count($fieldNames), \count($validationErrors))
\sprintf('Expected %s validation errors, found %s', \count($fieldNames), \count($validationErrors))
);
foreach ($fieldNames as $name) {
@@ -432,7 +432,7 @@ abstract class ControllerBaseTest extends WebTestCase
self::assertNotNull($location);
// check for meta refresh
$expectedMeta = sprintf('<meta http-equiv="refresh" content="0;url=\'%1$s\'" />', $location);
$expectedMeta = \sprintf('<meta http-equiv="refresh" content="0;url=\'%1$s\'" />', $location);
self::assertStringContainsString($expectedMeta, $client->getResponse()->getContent());
if ($url !== null) {

View File

@@ -243,7 +243,7 @@ class ProfileControllerTest extends ControllerBaseTest
}
/**
* @legacy
* @group legacy
*/
public function testApiTokenAction(): void
{

View File

@@ -53,8 +53,8 @@ abstract class AbstractUserPeriodControllerTest extends ControllerBaseTest
{
$client = $this->getClientForAuthenticatedUser(User::ROLE_SUPER_ADMIN);
$this->importReportingFixture(User::ROLE_SUPER_ADMIN);
$this->assertAccessIsGranted($client, sprintf('%s?user=%s&date=12999119191&sumType=%s', $this->getReportUrl(), $user, $dataType));
self::assertStringContainsString(sprintf('<div class="card-body %s', $this->getBoxId()), $client->getResponse()->getContent());
$this->assertAccessIsGranted($client, \sprintf('%s?user=%s&date=12999119191&sumType=%s', $this->getReportUrl(), $user, $dataType));
self::assertStringContainsString(\sprintf('<div class="card-body %s', $this->getBoxId()), $client->getResponse()->getContent());
$option = $client->getCrawler()->filterXPath("//select[@id='user']/option[@selected]");
self::assertEquals($user, $option->attr('value'));
$cell = $client->getCrawler()->filterXPath("//th[contains(@class, 'reportDataTypeTitle')]");
@@ -65,8 +65,8 @@ abstract class AbstractUserPeriodControllerTest extends ControllerBaseTest
{
$client = $this->getClientForAuthenticatedUser(User::ROLE_USER);
$this->importReportingFixture(User::ROLE_USER);
$this->assertAccessIsGranted($client, sprintf('%s?date=12999119191', $this->getReportUrl()));
self::assertStringContainsString(sprintf('<div class="card-body %s', $this->getBoxId()), $client->getResponse()->getContent());
$this->assertAccessIsGranted($client, \sprintf('%s?date=12999119191', $this->getReportUrl()));
self::assertStringContainsString(\sprintf('<div class="card-body %s', $this->getBoxId()), $client->getResponse()->getContent());
$select = $client->getCrawler()->filterXPath("//select[@id='user']");
self::assertEquals(0, $select->count());
$cell = $client->getCrawler()->filterXPath("//th[contains(@class, 'reportDataTypeTitle')]");

View File

@@ -56,8 +56,8 @@ abstract class AbstractUsersPeriodControllerTest extends ControllerBaseTest
{
$client = $this->getClientForAuthenticatedUser(User::ROLE_SUPER_ADMIN);
$this->importReportingFixture(User::ROLE_SUPER_ADMIN);
$this->assertAccessIsGranted($client, sprintf('%s?date=12999119191&sumType=%s', $this->getReportUrl(), $dataType));
self::assertStringContainsString(sprintf('<div class="card-body %s', $this->getBoxId()), $client->getResponse()->getContent());
$this->assertAccessIsGranted($client, \sprintf('%s?date=12999119191&sumType=%s', $this->getReportUrl(), $dataType));
self::assertStringContainsString(\sprintf('<div class="card-body %s', $this->getBoxId()), $client->getResponse()->getContent());
$cell = $client->getCrawler()->filterXPath("//th[contains(@class, 'reportDataTypeTitle')]");
self::assertEquals($title, $cell->text());
}
@@ -69,8 +69,8 @@ abstract class AbstractUsersPeriodControllerTest extends ControllerBaseTest
{
$client = $this->getClientForAuthenticatedUser(User::ROLE_TEAMLEAD);
$this->importReportingFixture(User::ROLE_TEAMLEAD);
$this->assertAccessIsGranted($client, sprintf('%s?date=12999119191&sumType=%s', $this->getReportUrl(), $dataType));
self::assertStringContainsString(sprintf('<div class="card-body %s', $this->getBoxId()), $client->getResponse()->getContent());
$this->assertAccessIsGranted($client, \sprintf('%s?date=12999119191&sumType=%s', $this->getReportUrl(), $dataType));
self::assertStringContainsString(\sprintf('<div class="card-body %s', $this->getBoxId()), $client->getResponse()->getContent());
$select = $client->getCrawler()->filterXPath("//select[@id='user']");
self::assertEquals(0, $select->count());
$cell = $client->getCrawler()->filterXPath("//th[contains(@class, 'reportDataTypeTitle')]");
@@ -84,7 +84,7 @@ abstract class AbstractUsersPeriodControllerTest extends ControllerBaseTest
{
$client = $this->getClientForAuthenticatedUser(User::ROLE_SUPER_ADMIN);
$this->importReportingFixture(User::ROLE_SUPER_ADMIN);
$this->request($client, sprintf('%s?date=12999119191&sumType=%s', $this->getReportExportUrl(), $dataType));
$this->request($client, \sprintf('%s?date=12999119191&sumType=%s', $this->getReportExportUrl(), $dataType));
$response = $client->getResponse();
$this->assertTrue($response->isSuccessful());
self::assertInstanceOf(BinaryFileResponse::class, $response);