Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"dama/doctrine-test-bundle": "^v8.2.0",
"friendsofphp/php-cs-fixer": "v3.95.13",
"phpunit/phpunit": "^12.0",
"rector/rector": "2.4.5",
"rector/rector": "2.5.4",
"roave/security-advisories": "dev-latest",
"symfony/browser-kit": "v8.0.8",
"symfony/css-selector": "v8.0.9",
Expand Down
16 changes: 8 additions & 8 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion src/Command/AliasAddCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Validator\ConstraintViolation;
use Symfony\Component\Validator\Validator\ValidatorInterface;

class AliasAddCommand extends Command
Expand Down
1 change: 0 additions & 1 deletion src/Command/DomainAddCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Validator\ConstraintViolation;
use Symfony\Component\Validator\Validator\ValidatorInterface;

class DomainAddCommand extends Command
Expand Down
1 change: 0 additions & 1 deletion src/Command/InitSetupCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Question\Question;
use Symfony\Component\Validator\ConstraintViolation;
use Symfony\Component\Validator\Validator\ValidatorInterface;

class InitSetupCommand extends Command
Expand Down
1 change: 0 additions & 1 deletion src/Command/UserAddCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Question\Question;
use Symfony\Component\Validator\ConstraintViolation;
use Symfony\Component\Validator\Validator\ValidatorInterface;

class UserAddCommand extends Command
Expand Down
3 changes: 2 additions & 1 deletion src/Controller/Admin/DashboardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ public function configureDashboard(): Dashboard
{
return Dashboard::new()
->setTitle('mailserver-admin')
->setFaviconPath('favicon.svg');
->setFaviconPath('favicon.svg')
->generateRelativeUrls();
}

#[\Override]
Expand Down
4 changes: 3 additions & 1 deletion templates/bundles/EasyAdminBundle/page/login.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
<div class="text-center mt-5 mb-4">
{{ include('admin/_includes/logo.html.twig') }}
</div>
{{ parent() }}
<div class="text-center">
{{ parent() }}
</div>
{% endblock %}

{% block head_favicon %}
Expand Down
19 changes: 19 additions & 0 deletions tests/Integration/Controller/Admin/DKIMCrudControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,25 @@ public function testRecreateKey(): void
static::assertNotEmpty($updatedDomain->getDkimPrivateKey());
}

public function testRecreateKeyRelativeFormUrl(): void
{
$this->loginClient($this->client);

$domainRepository = $this->entityManager->getRepository(Domain::class);
\assert($domainRepository instanceof DomainRepository);
$domain = $domainRepository->findOneBy(['name' => 'example.com']);
static::assertInstanceOf(Domain::class, $domain);

$this->client->request(Request::METHOD_GET, $this->generateEditFormUrl($domain->getId()));
static::assertResponseIsSuccessful();

$form = $this->client->getCrawler()->filter('form.action-recreateKey');
$action = $form->attr('action');

static::assertStringStartsNotWith('http://', $action, 'Relative URL configuration is required for the DashboardController.');
static::assertStringStartsNotWith('https://', $action, 'Relative URL configuration is required for the DashboardController.');
}

protected function getControllerFqcn(): string
{
return DKIMCrudController::class;
Expand Down
9 changes: 9 additions & 0 deletions tests/Unit/Command/RedisSyncCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,17 @@ class RedisSyncCommandTest extends TestCase
{
private CommandTester $commandTester;

/**
* @var MockObject&Manager
*/
private MockObject $managerMock;
/**
* @var MockObject&AccountWriter
*/
private MockObject $accountWriterMock;
/**
* @var MockObject&ConnectionCheckService
*/
private MockObject $connectionCheckServiceMock;

protected function setUp(): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,8 @@ public function testChartsFragmentWithData(): void
'auth_failures' => new RateSeriesDto('auth_failures', '/min', [], []),
];
$mailDeliveryRates = new RateSeriesDto('mail_deliveries', '/min', [], []);
$authChart = $this->createMock(Chart::class);
$mailDeliveriesChart = $this->createMock(Chart::class);
$authChart = $this->createStub(Chart::class);
$mailDeliveriesChart = $this->createStub(Chart::class);

$this->sampler
->expects($this->once())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public function testSummary(): void
public function testThroughputWithValidType(): void
{
$series = new TimeSeriesDto(TimeSeriesDto::TYPE_DAY, ['00:00'], ['spam' => [10]]);
$chart = $this->createMock(Chart::class);
$chart = $this->createStub(Chart::class);

$this->statsService
->expects($this->once())
Expand Down Expand Up @@ -134,7 +134,7 @@ public function testThroughputWithValidType(): void
public function testThroughputWithInvalidType(): void
{
$series = TimeSeriesDto::empty('day');
$chart = $this->createMock(Chart::class);
$chart = $this->createStub(Chart::class);

$this->statsService
->expects($this->once())
Expand All @@ -161,7 +161,7 @@ public function testThroughputWithInvalidType(): void
public function testActionsPie(): void
{
$distribution = new ActionDistributionDto(['reject' => 100]);
$chart = $this->createMock(Chart::class);
$chart = $this->createStub(Chart::class);

$this->statsService
->expects($this->once())
Expand Down
6 changes: 3 additions & 3 deletions tests/Unit/Service/ConnectionCheckServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public function testCheckMySQLWithAllowEmptyDatabaseSuccess(): void
->expects($this->once())
->method('executeQuery')
->with('SELECT 1')
->willReturn($this->createMock(Result::class));
->willReturn($this->createStub(Result::class));

$this->entityManager
->expects($this->once())
Expand Down Expand Up @@ -404,7 +404,7 @@ public function testCheckAllWithAllowEmptyDatabase(): void
->expects($this->once())
->method('executeQuery')
->with('SELECT 1')
->willReturn($this->createMock(Result::class));
->willReturn($this->createStub(Result::class));

$this->entityManager
->expects($this->once())
Expand Down Expand Up @@ -438,7 +438,7 @@ public function testCheckAllWithAllowEmptyDatabaseAndAllServices(): void
->expects($this->once())
->method('executeQuery')
->with('SELECT 1')
->willReturn($this->createMock(Result::class));
->willReturn($this->createStub(Result::class));

$this->entityManager
->expects($this->once())
Expand Down
3 changes: 3 additions & 0 deletions tests/Unit/Service/DKIM/DomainKeyReaderServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@

class DomainKeyReaderServiceTest extends TestCase
{
/**
* @var MockObject&DnsLookupInterface
*/
private MockObject $resolver;

private DomainKeyReaderService $instance;
Expand Down
2 changes: 2 additions & 0 deletions tests/Unit/Service/Security/User/OAuth/UserProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@
use Doctrine\ORM\EntityManagerInterface;
use HWI\Bundle\OAuthBundle\OAuth\Response\PathUserResponse;
use HWI\Bundle\OAuthBundle\Security\Core\Exception\AccountNotLinkedException;
use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Security\Core\Exception\UnsupportedUserException;
use Symfony\Component\Security\Core\User\UserInterface;

#[AllowMockObjectsWithoutExpectations]
class UserProviderTest extends TestCase
{
private MockObject&UserRepository $userRepository;
Expand Down
Loading