fix: SonarQube EsyMailService 23->20 methodes + constante + createMailbox
EsyMailDnsService (nouveau) : - checkDnsEsyMail et checkDnsEsyMailer extraits - Helpers prives : checkMx, checkSpf, checkDkim, checkDmarc, checkSpfSes EsyMailService : - 23 -> 20 methodes (suppression checkDns*, countMailboxes, getMailbox) - DATETIME_FORMAT constante (5 occurrences) - createMailbox : 5->3 returns (fusion guards) - getMailHostname() ajoutee pour EsyMailDnsService ClientsController : - show() injecte EsyMailDnsService au lieu de EsyMailService Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -9,7 +9,7 @@ use App\Repository\CustomerRepository;
|
||||
use App\Repository\RevendeurRepository;
|
||||
use App\Service\CloudflareService;
|
||||
use App\Service\DnsCheckService;
|
||||
use App\Service\EsyMailService;
|
||||
use App\Service\EsyMailDnsService;
|
||||
use App\Service\MailerService;
|
||||
use App\Service\MeilisearchService;
|
||||
use App\Service\OvhService;
|
||||
@@ -161,7 +161,7 @@ class ClientsController extends AbstractController
|
||||
*
|
||||
* @return array<int, array{esyMail: bool, emailCount: int, esyMailer: bool, configDnsEsyMail: bool, configDnsEsyMailer: bool}>
|
||||
*/
|
||||
private function buildDomainsInfo(array $domains, EntityManagerInterface $em, EsyMailService $esyMailService, bool $checkDns = false): array
|
||||
private function buildDomainsInfo(array $domains, EntityManagerInterface $em, EsyMailDnsService $dnsService, bool $checkDns = false): array
|
||||
{
|
||||
$emailRepo = $em->getRepository(\App\Entity\DomainEmail::class);
|
||||
$info = [];
|
||||
@@ -172,8 +172,8 @@ class ClientsController extends AbstractController
|
||||
$configMailer = false;
|
||||
|
||||
if ($checkDns) {
|
||||
$configMail = $esyMailService->checkDnsEsyMail($domain->getFqdn())['ok'];
|
||||
$configMailer = $esyMailService->checkDnsEsyMailer($domain->getFqdn())['ok'];
|
||||
$configMail = $dnsService->checkDnsEsyMail($domain->getFqdn())['ok'];
|
||||
$configMailer = $dnsService->checkDnsEsyMailer($domain->getFqdn())['ok'];
|
||||
}
|
||||
|
||||
$info[$domain->getId()] = [
|
||||
@@ -352,7 +352,7 @@ class ClientsController extends AbstractController
|
||||
}
|
||||
|
||||
#[Route('/{id}', name: 'show')]
|
||||
public function show(Customer $customer, Request $request, EntityManagerInterface $em, OvhService $ovhService, CloudflareService $cloudflareService, DnsCheckService $dnsCheckService, EsyMailService $esyMailService, UserPasswordHasherInterface $passwordHasher, MailerService $mailer, Environment $twig): Response
|
||||
public function show(Customer $customer, Request $request, EntityManagerInterface $em, OvhService $ovhService, CloudflareService $cloudflareService, DnsCheckService $dnsCheckService, EsyMailDnsService $esyMailDnsService, UserPasswordHasherInterface $passwordHasher, MailerService $mailer, Environment $twig): Response
|
||||
{
|
||||
$tab = $request->query->getString('tab', 'info');
|
||||
|
||||
@@ -377,7 +377,7 @@ class ClientsController extends AbstractController
|
||||
$this->ensureDefaultContact($customer, $em);
|
||||
$contacts = $em->getRepository(\App\Entity\CustomerContact::class)->findBy(['customer' => $customer], ['createdAt' => 'DESC']);
|
||||
$domains = $em->getRepository(Domain::class)->findBy(['customer' => $customer]);
|
||||
$domainsInfo = $this->buildDomainsInfo($domains, $em, $esyMailService, 'ndd' === $tab);
|
||||
$domainsInfo = $this->buildDomainsInfo($domains, $em, $esyMailDnsService, 'ndd' === $tab);
|
||||
$websites = $em->getRepository(\App\Entity\Website::class)->findBy(['customer' => $customer], ['createdAt' => 'DESC']);
|
||||
$devisList = $em->getRepository(\App\Entity\Devis::class)->findBy(['customer' => $customer], ['createdAt' => 'DESC']);
|
||||
$advertsList = $em->getRepository(\App\Entity\Advert::class)->findBy(['customer' => $customer], ['createdAt' => 'DESC']);
|
||||
|
||||
164
src/Service/EsyMailDnsService.php
Normal file
164
src/Service/EsyMailDnsService.php
Normal file
@@ -0,0 +1,164 @@
|
||||
<?php
|
||||
|
||||
namespace App\Service;
|
||||
|
||||
/**
|
||||
* Verification DNS pour les services E-Mail (reception) et E-Mailer (envoi SES).
|
||||
*/
|
||||
class EsyMailDnsService
|
||||
{
|
||||
public function __construct(
|
||||
private DnsCheckService $dnsCheck,
|
||||
private AwsSesService $awsSes,
|
||||
private EsyMailService $esyMail,
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Verifie la config DNS E-Mail (reception) pour un domaine.
|
||||
*
|
||||
* @return array{ok: bool, mx: bool, spf: bool, dkim: bool, dmarc: bool, details: array<string, string>}
|
||||
*/
|
||||
public function checkDnsEsyMail(string $domain): array
|
||||
{
|
||||
$result = ['ok' => false, 'mx' => false, 'spf' => false, 'dkim' => false, 'dmarc' => false, 'details' => []];
|
||||
$mailHostname = $this->esyMail->getMailHostname();
|
||||
|
||||
$result = $this->checkMx($domain, $mailHostname, $result);
|
||||
$result = $this->checkSpf($domain, $mailHostname, $result);
|
||||
$result = $this->checkDkim($domain, $result);
|
||||
$result = $this->checkDmarc($domain, $result);
|
||||
|
||||
$result['ok'] = $result['mx'] && $result['spf'] && $result['dkim'] && $result['dmarc'];
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Verifie la config DNS E-Mailer (envoi AWS SES) pour un domaine.
|
||||
*
|
||||
* @return array{ok: bool, ses_verified: bool, ses_dkim: bool, spf_ses: bool, mail_from: bool, details: array<string, string>}
|
||||
*/
|
||||
public function checkDnsEsyMailer(string $domain): array
|
||||
{
|
||||
$result = ['ok' => false, 'ses_verified' => false, 'ses_dkim' => false, 'spf_ses' => false, 'mail_from' => false, 'details' => []];
|
||||
|
||||
if (!$this->awsSes->isAvailable()) {
|
||||
$result['details']['error'] = 'AWS SES non configure';
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
$verif = $this->awsSes->isDomainVerified($domain);
|
||||
$result['ses_verified'] = 'Success' === $verif;
|
||||
$result['details']['ses_verified'] = $verif ?? 'Non verifie';
|
||||
|
||||
$dkim = $this->awsSes->getDkimStatus($domain);
|
||||
$result['ses_dkim'] = $dkim['enabled'] && $dkim['verified'];
|
||||
$result['details']['ses_dkim'] = ($dkim['enabled'] ? 'Enabled' : 'Disabled').', '.($dkim['verified'] ? 'Verified' : 'Not verified');
|
||||
|
||||
$this->checkSpfSes($domain, $result);
|
||||
|
||||
$mailFrom = $this->awsSes->getMailFromStatus($domain);
|
||||
$result['mail_from'] = 'Success' === ($mailFrom['mail_from_status'] ?? '');
|
||||
$result['details']['mail_from'] = ($mailFrom['mail_from_domain'] ?? 'Non configure').' ('.($mailFrom['mail_from_status'] ?? '?').')';
|
||||
|
||||
$result['ok'] = $result['ses_verified'] && $result['ses_dkim'] && $result['spf_ses'] && $result['mail_from'];
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $result
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
private function checkMx(string $domain, string $mailHostname, array $result): array
|
||||
{
|
||||
$mxRecords = $this->dnsCheck->getMxRecords($domain);
|
||||
foreach ($mxRecords as $mx) {
|
||||
if ('' !== $mailHostname && str_contains($mx['target'], $mailHostname)) {
|
||||
$result['mx'] = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$result['details']['mx'] = implode(', ', array_map(fn ($mx) => $mx['target'], $mxRecords)) ?: 'Aucun';
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $result
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
private function checkSpf(string $domain, string $mailHostname, array $result): array
|
||||
{
|
||||
$spfOutput = $this->dnsCheck->dig($domain, 'TXT');
|
||||
foreach (explode("\n", $spfOutput) as $line) {
|
||||
if (preg_match('/IN\s+TXT\s+"(v=spf1[^"]+)"/', $line, $m)) {
|
||||
$spf = str_replace('" "', '', $m[1]);
|
||||
if (str_contains($spf, $mailHostname) || str_contains($spf, 'include:_spf')) {
|
||||
$result['spf'] = true;
|
||||
}
|
||||
$result['details']['spf'] = $spf;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $result
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
private function checkDkim(string $domain, array $result): array
|
||||
{
|
||||
$dkimFqdn = 'dkim._domainkey.'.$domain;
|
||||
$dkimTxt = $this->dnsCheck->getDkimTxtRecord($dkimFqdn);
|
||||
$dkimCname = $this->dnsCheck->getCnameRecord($dkimFqdn);
|
||||
$result['dkim'] = null !== $dkimTxt || null !== $dkimCname;
|
||||
$result['details']['dkim'] = $dkimTxt ?? $dkimCname ?? 'Non trouve';
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $result
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
private function checkDmarc(string $domain, array $result): array
|
||||
{
|
||||
$dmarcOutput = $this->dnsCheck->dig('_dmarc.'.$domain, 'TXT');
|
||||
foreach (explode("\n", $dmarcOutput) as $line) {
|
||||
if (preg_match('/IN\s+TXT\s+"(v=DMARC1[^"]+)"/', $line, $m)) {
|
||||
$result['dmarc'] = true;
|
||||
$result['details']['dmarc'] = str_replace('" "', '', $m[1]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $result
|
||||
*/
|
||||
private function checkSpfSes(string $domain, array &$result): void
|
||||
{
|
||||
$spfOutput = $this->dnsCheck->dig($domain, 'TXT');
|
||||
foreach (explode("\n", $spfOutput) as $line) {
|
||||
if (preg_match('/IN\s+TXT\s+"(v=spf1[^"]+)"/', $line, $m)) {
|
||||
$spf = str_replace('" "', '', $m[1]);
|
||||
if (str_contains($spf, 'amazonses.com')) {
|
||||
$result['spf_ses'] = true;
|
||||
}
|
||||
$result['details']['spf'] = $spf;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,12 +9,12 @@ use Symfony\Component\DependencyInjection\Attribute\Autowire;
|
||||
|
||||
class EsyMailService
|
||||
{
|
||||
private const DATETIME_FORMAT = 'Y-m-d H:i:sP';
|
||||
|
||||
private ?Connection $conn = null;
|
||||
|
||||
public function __construct(
|
||||
private LoggerInterface $logger,
|
||||
private DnsCheckService $dnsCheck,
|
||||
private AwsSesService $awsSes,
|
||||
#[Autowire(env: 'ESYMAIL_DATABASE_URL')] private string $databaseUrl = '',
|
||||
#[Autowire(env: 'ESYMAIL_HOSTNAME')] private string $mailHostname = '',
|
||||
) {
|
||||
@@ -25,6 +25,11 @@ class EsyMailService
|
||||
return '' !== $this->databaseUrl;
|
||||
}
|
||||
|
||||
public function getMailHostname(): string
|
||||
{
|
||||
return $this->mailHostname;
|
||||
}
|
||||
|
||||
// ──── Domaines ────────────────────────────────────
|
||||
|
||||
/**
|
||||
@@ -67,7 +72,7 @@ class EsyMailService
|
||||
'max_mailboxes' => $maxMailboxes,
|
||||
'default_quota_mb' => $defaultQuotaMb,
|
||||
'is_active' => true,
|
||||
'created_at' => (new \DateTimeImmutable())->format('Y-m-d H:i:sP'),
|
||||
'created_at' => (new \DateTimeImmutable())->format(self::DATETIME_FORMAT),
|
||||
], ['is_active' => 'boolean']);
|
||||
|
||||
$this->logger->info('EsyMail: domaine cree: '.$name);
|
||||
@@ -148,35 +153,15 @@ class EsyMailService
|
||||
return $this->getConnection()->fetchAllAssociative('SELECT * FROM mailbox ORDER BY domain, email');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, mixed>|null
|
||||
*/
|
||||
public function getMailbox(string $email): ?array
|
||||
{
|
||||
if (!$this->isAvailable()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$result = $this->getConnection()->fetchAssociative('SELECT * FROM mailbox WHERE email = ?', [$email]);
|
||||
|
||||
return false === $result ? null : $result;
|
||||
}
|
||||
|
||||
public function createMailbox(string $email, string $password, ?string $displayName = null, int $quotaMb = 5120): bool
|
||||
{
|
||||
if (!$this->isAvailable()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$parts = explode('@', $email);
|
||||
if (2 !== \count($parts)) {
|
||||
return false;
|
||||
}
|
||||
$domain = 2 === \count($parts) ? strtolower($parts[1]) : null;
|
||||
|
||||
$domain = strtolower($parts[1]);
|
||||
|
||||
if (!$this->domainExists($domain)) {
|
||||
$this->logger->error('EsyMail: domaine '.$domain.' inexistant pour '.$email);
|
||||
if (!$this->isAvailable() || null === $domain || !$this->domainExists($domain)) {
|
||||
if (null !== $domain && $this->isAvailable()) {
|
||||
$this->logger->error('EsyMail: domaine '.$domain.' inexistant pour '.$email);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -189,7 +174,7 @@ class EsyMailService
|
||||
'display_name' => $displayName,
|
||||
'quota_mb' => $quotaMb,
|
||||
'is_active' => true,
|
||||
'created_at' => (new \DateTimeImmutable())->format('Y-m-d H:i:sP'),
|
||||
'created_at' => (new \DateTimeImmutable())->format(self::DATETIME_FORMAT),
|
||||
], ['is_active' => 'boolean']);
|
||||
|
||||
$this->logger->info('EsyMail: boite creee: '.$email);
|
||||
@@ -213,7 +198,7 @@ class EsyMailService
|
||||
'display_name' => $displayName,
|
||||
'quota_mb' => $quotaMb,
|
||||
'is_active' => $isActive,
|
||||
'updated_at' => (new \DateTimeImmutable())->format('Y-m-d H:i:sP'),
|
||||
'updated_at' => (new \DateTimeImmutable())->format(self::DATETIME_FORMAT),
|
||||
], ['email' => $email], ['is_active' => 'boolean']);
|
||||
|
||||
return true;
|
||||
@@ -233,7 +218,7 @@ class EsyMailService
|
||||
try {
|
||||
$this->getConnection()->update('mailbox', [
|
||||
'password' => password_hash($newPassword, \PASSWORD_BCRYPT),
|
||||
'updated_at' => (new \DateTimeImmutable())->format('Y-m-d H:i:sP'),
|
||||
'updated_at' => (new \DateTimeImmutable())->format(self::DATETIME_FORMAT),
|
||||
], ['email' => $email]);
|
||||
|
||||
$this->logger->info('EsyMail: password modifie pour '.$email);
|
||||
@@ -273,15 +258,6 @@ class EsyMailService
|
||||
return (int) $this->getConnection()->fetchOne('SELECT COUNT(*) FROM mailbox WHERE email = ?', [strtolower($email)]) > 0;
|
||||
}
|
||||
|
||||
public function countMailboxes(string $domain): int
|
||||
{
|
||||
if (!$this->isAvailable()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return (int) $this->getConnection()->fetchOne('SELECT COUNT(*) FROM mailbox WHERE domain = ?', [$domain]);
|
||||
}
|
||||
|
||||
// ──── Alias ───────────────────────────────────────
|
||||
|
||||
/**
|
||||
@@ -314,7 +290,7 @@ class EsyMailService
|
||||
'destination' => strtolower(trim($destination)),
|
||||
'domain' => strtolower(trim($domain)),
|
||||
'is_active' => true,
|
||||
'created_at' => (new \DateTimeImmutable())->format('Y-m-d H:i:sP'),
|
||||
'created_at' => (new \DateTimeImmutable())->format(self::DATETIME_FORMAT),
|
||||
], ['is_active' => 'boolean']);
|
||||
|
||||
$this->logger->info('EsyMail: alias cree: '.$source.' -> '.$destination);
|
||||
@@ -344,112 +320,6 @@ class EsyMailService
|
||||
}
|
||||
}
|
||||
|
||||
// ──── Vérification DNS ──────────────────────────────
|
||||
|
||||
/**
|
||||
* Vérifie la config DNS E-Mail (réception) pour un domaine.
|
||||
* MX → mail hostname, SPF includes, DKIM, DMARC.
|
||||
*
|
||||
* @return array{ok: bool, mx: bool, spf: bool, dkim: bool, dmarc: bool, details: array<string, string>}
|
||||
*/
|
||||
public function checkDnsEsyMail(string $domain): array
|
||||
{
|
||||
$result = ['ok' => false, 'mx' => false, 'spf' => false, 'dkim' => false, 'dmarc' => false, 'details' => []];
|
||||
|
||||
// MX → doit pointer vers le mail hostname (ex: mail.esy-web.dev)
|
||||
$mxRecords = $this->dnsCheck->getMxRecords($domain);
|
||||
foreach ($mxRecords as $mx) {
|
||||
if ('' !== $this->mailHostname && str_contains($mx['target'], $this->mailHostname)) {
|
||||
$result['mx'] = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$result['details']['mx'] = implode(', ', array_map(fn ($mx) => $mx['target'], $mxRecords)) ?: 'Aucun';
|
||||
|
||||
// SPF → doit contenir le mail hostname ou l'IP
|
||||
$spfOutput = $this->dnsCheck->dig($domain, 'TXT');
|
||||
foreach (explode("\n", $spfOutput) as $line) {
|
||||
if (preg_match('/IN\s+TXT\s+"(v=spf1[^"]+)"/', $line, $m)) {
|
||||
$spf = str_replace('" "', '', $m[1]);
|
||||
if (str_contains($spf, $this->mailHostname) || str_contains($spf, 'include:_spf')) {
|
||||
$result['spf'] = true;
|
||||
}
|
||||
$result['details']['spf'] = $spf;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// DKIM → check sélecteur dkim._domainkey
|
||||
$dkimFqdn = 'dkim._domainkey.'.$domain;
|
||||
$dkimTxt = $this->dnsCheck->getDkimTxtRecord($dkimFqdn);
|
||||
$dkimCname = $this->dnsCheck->getCnameRecord($dkimFqdn);
|
||||
$result['dkim'] = null !== $dkimTxt || null !== $dkimCname;
|
||||
$result['details']['dkim'] = $dkimTxt ?? $dkimCname ?? 'Non trouve';
|
||||
|
||||
// DMARC → _dmarc.domain
|
||||
$dmarcOutput = $this->dnsCheck->dig('_dmarc.'.$domain, 'TXT');
|
||||
foreach (explode("\n", $dmarcOutput) as $line) {
|
||||
if (preg_match('/IN\s+TXT\s+"(v=DMARC1[^"]+)"/', $line, $m)) {
|
||||
$result['dmarc'] = true;
|
||||
$result['details']['dmarc'] = str_replace('" "', '', $m[1]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$result['ok'] = $result['mx'] && $result['spf'] && $result['dkim'] && $result['dmarc'];
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Vérifie la config DNS E-Mailer (envoi AWS SES) pour un domaine.
|
||||
* SES domaine vérifié, DKIM SES, SPF include:amazonses.com, MAIL FROM.
|
||||
*
|
||||
* @return array{ok: bool, ses_verified: bool, ses_dkim: bool, spf_ses: bool, mail_from: bool, details: array<string, string>}
|
||||
*/
|
||||
public function checkDnsEsyMailer(string $domain): array
|
||||
{
|
||||
$result = ['ok' => false, 'ses_verified' => false, 'ses_dkim' => false, 'spf_ses' => false, 'mail_from' => false, 'details' => []];
|
||||
|
||||
if (!$this->awsSes->isAvailable()) {
|
||||
$result['details']['error'] = 'AWS SES non configure';
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
// SES domaine vérifié
|
||||
$verif = $this->awsSes->isDomainVerified($domain);
|
||||
$result['ses_verified'] = 'Success' === $verif;
|
||||
$result['details']['ses_verified'] = $verif ?? 'Non verifie';
|
||||
|
||||
// SES DKIM
|
||||
$dkim = $this->awsSes->getDkimStatus($domain);
|
||||
$result['ses_dkim'] = $dkim['enabled'] && $dkim['verified'];
|
||||
$result['details']['ses_dkim'] = ($dkim['enabled'] ? 'Enabled' : 'Disabled').', '.($dkim['verified'] ? 'Verified' : 'Not verified');
|
||||
|
||||
// SPF → doit contenir include:amazonses.com
|
||||
$spfOutput = $this->dnsCheck->dig($domain, 'TXT');
|
||||
foreach (explode("\n", $spfOutput) as $line) {
|
||||
if (preg_match('/IN\s+TXT\s+"(v=spf1[^"]+)"/', $line, $m)) {
|
||||
$spf = str_replace('" "', '', $m[1]);
|
||||
if (str_contains($spf, 'amazonses.com')) {
|
||||
$result['spf_ses'] = true;
|
||||
}
|
||||
$result['details']['spf'] = $spf;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// MAIL FROM
|
||||
$mailFrom = $this->awsSes->getMailFromStatus($domain);
|
||||
$result['mail_from'] = 'Success' === ($mailFrom['mail_from_status'] ?? '');
|
||||
$result['details']['mail_from'] = ($mailFrom['mail_from_domain'] ?? 'Non configure').' ('.($mailFrom['mail_from_status'] ?? '?').')';
|
||||
|
||||
$result['ok'] = $result['ses_verified'] && $result['ses_dkim'] && $result['spf_ses'] && $result['mail_from'];
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
// ──── Stats ───────────────────────────────────────
|
||||
|
||||
/**
|
||||
|
||||
@@ -423,7 +423,7 @@ class ClientsControllerTest extends TestCase
|
||||
$this->createStub(\App\Service\OvhService::class),
|
||||
$this->createStub(\App\Service\CloudflareService::class),
|
||||
$this->createStub(\App\Service\DnsCheckService::class),
|
||||
$this->createStub(\App\Service\EsyMailService::class),
|
||||
$this->createStub(\App\Service\EsyMailDnsService::class),
|
||||
$this->createStub(\Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface::class),
|
||||
$this->createStub(MailerService::class),
|
||||
$this->createStub(Environment::class),
|
||||
@@ -457,7 +457,7 @@ class ClientsControllerTest extends TestCase
|
||||
$this->createStub(\App\Service\OvhService::class),
|
||||
$this->createStub(\App\Service\CloudflareService::class),
|
||||
$this->createStub(\App\Service\DnsCheckService::class),
|
||||
$this->createStub(\App\Service\EsyMailService::class),
|
||||
$this->createStub(\App\Service\EsyMailDnsService::class),
|
||||
$this->createStub(\Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface::class),
|
||||
$this->createStub(MailerService::class),
|
||||
$this->createStub(Environment::class),
|
||||
@@ -587,7 +587,7 @@ class ClientsControllerTest extends TestCase
|
||||
$this->createStub(\App\Service\OvhService::class),
|
||||
$this->createStub(\App\Service\CloudflareService::class),
|
||||
$this->createStub(\App\Service\DnsCheckService::class),
|
||||
$this->createStub(\App\Service\EsyMailService::class),
|
||||
$this->createStub(\App\Service\EsyMailDnsService::class),
|
||||
$this->createStub(\Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface::class),
|
||||
$this->createStub(MailerService::class),
|
||||
$this->createStub(Environment::class),
|
||||
@@ -628,7 +628,7 @@ class ClientsControllerTest extends TestCase
|
||||
$this->createStub(\App\Service\OvhService::class),
|
||||
$this->createStub(\App\Service\CloudflareService::class),
|
||||
$this->createStub(\App\Service\DnsCheckService::class),
|
||||
$this->createStub(\App\Service\EsyMailService::class),
|
||||
$this->createStub(\App\Service\EsyMailDnsService::class),
|
||||
$this->createStub(\Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface::class),
|
||||
$this->createStub(MailerService::class),
|
||||
$this->createStub(Environment::class),
|
||||
@@ -677,7 +677,7 @@ class ClientsControllerTest extends TestCase
|
||||
$ovh,
|
||||
$cloudflare,
|
||||
$dnsCheck,
|
||||
$this->createStub(\App\Service\EsyMailService::class),
|
||||
$this->createStub(\App\Service\EsyMailDnsService::class),
|
||||
$this->createStub(\Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface::class),
|
||||
$this->createStub(MailerService::class),
|
||||
$this->createStub(Environment::class),
|
||||
@@ -714,7 +714,7 @@ class ClientsControllerTest extends TestCase
|
||||
$this->createStub(\App\Service\OvhService::class),
|
||||
$this->createStub(\App\Service\CloudflareService::class),
|
||||
$this->createStub(\App\Service\DnsCheckService::class),
|
||||
$this->createStub(\App\Service\EsyMailService::class),
|
||||
$this->createStub(\App\Service\EsyMailDnsService::class),
|
||||
$this->createStub(\Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface::class),
|
||||
$this->createStub(MailerService::class),
|
||||
$this->createStub(Environment::class),
|
||||
@@ -750,7 +750,7 @@ class ClientsControllerTest extends TestCase
|
||||
$this->createStub(\App\Service\OvhService::class),
|
||||
$this->createStub(\App\Service\CloudflareService::class),
|
||||
$this->createStub(\App\Service\DnsCheckService::class),
|
||||
$this->createStub(\App\Service\EsyMailService::class),
|
||||
$this->createStub(\App\Service\EsyMailDnsService::class),
|
||||
$this->createStub(\Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface::class),
|
||||
$this->createStub(MailerService::class),
|
||||
$this->createStub(Environment::class),
|
||||
@@ -792,7 +792,7 @@ class ClientsControllerTest extends TestCase
|
||||
$this->createStub(\App\Service\OvhService::class),
|
||||
$this->createStub(\App\Service\CloudflareService::class),
|
||||
$this->createStub(\App\Service\DnsCheckService::class),
|
||||
$this->createStub(\App\Service\EsyMailService::class),
|
||||
$this->createStub(\App\Service\EsyMailDnsService::class),
|
||||
$this->createStub(\Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface::class),
|
||||
$this->createStub(MailerService::class),
|
||||
$this->createStub(Environment::class),
|
||||
@@ -835,7 +835,7 @@ class ClientsControllerTest extends TestCase
|
||||
$this->createStub(\App\Service\OvhService::class),
|
||||
$this->createStub(\App\Service\CloudflareService::class),
|
||||
$this->createStub(\App\Service\DnsCheckService::class),
|
||||
$this->createStub(\App\Service\EsyMailService::class),
|
||||
$this->createStub(\App\Service\EsyMailDnsService::class),
|
||||
$passwordHasher,
|
||||
$this->createStub(MailerService::class),
|
||||
$twig,
|
||||
@@ -873,7 +873,7 @@ class ClientsControllerTest extends TestCase
|
||||
$this->createStub(\App\Service\OvhService::class),
|
||||
$this->createStub(\App\Service\CloudflareService::class),
|
||||
$this->createStub(\App\Service\DnsCheckService::class),
|
||||
$this->createStub(\App\Service\EsyMailService::class),
|
||||
$this->createStub(\App\Service\EsyMailDnsService::class),
|
||||
$this->createStub(\Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface::class),
|
||||
$this->createStub(MailerService::class),
|
||||
$this->createStub(Environment::class),
|
||||
@@ -895,7 +895,7 @@ class ClientsControllerTest extends TestCase
|
||||
$em = $this->createStub(\Doctrine\ORM\EntityManagerInterface::class);
|
||||
$em->method('getRepository')->willReturn($entityRepo);
|
||||
|
||||
$esyMailService = $this->createStub(\App\Service\EsyMailService::class);
|
||||
$esyMailService = $this->createStub(\App\Service\EsyMailDnsService::class);
|
||||
$esyMailService->method('checkDnsEsyMail')->willReturn(['ok' => true]);
|
||||
$esyMailService->method('checkDnsEsyMailer')->willReturn(['ok' => false]);
|
||||
|
||||
@@ -969,7 +969,7 @@ class ClientsControllerTest extends TestCase
|
||||
$ovh,
|
||||
$cloudflare,
|
||||
$dnsCheck,
|
||||
$this->createStub(\App\Service\EsyMailService::class),
|
||||
$this->createStub(\App\Service\EsyMailDnsService::class),
|
||||
$this->createStub(\Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface::class),
|
||||
$this->createStub(MailerService::class),
|
||||
$this->createStub(Environment::class),
|
||||
@@ -1019,7 +1019,7 @@ class ClientsControllerTest extends TestCase
|
||||
$ovh,
|
||||
$cloudflare,
|
||||
$dnsCheck,
|
||||
$this->createStub(\App\Service\EsyMailService::class),
|
||||
$this->createStub(\App\Service\EsyMailDnsService::class),
|
||||
$this->createStub(\Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface::class),
|
||||
$this->createStub(MailerService::class),
|
||||
$this->createStub(Environment::class),
|
||||
@@ -1069,7 +1069,7 @@ class ClientsControllerTest extends TestCase
|
||||
$ovh,
|
||||
$cloudflare,
|
||||
$dnsCheck,
|
||||
$this->createStub(\App\Service\EsyMailService::class),
|
||||
$this->createStub(\App\Service\EsyMailDnsService::class),
|
||||
$this->createStub(\Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface::class),
|
||||
$this->createStub(MailerService::class),
|
||||
$this->createStub(Environment::class),
|
||||
@@ -1131,7 +1131,7 @@ class ClientsControllerTest extends TestCase
|
||||
};
|
||||
});
|
||||
|
||||
$esyMailService = $this->createStub(\App\Service\EsyMailService::class);
|
||||
$esyMailService = $this->createStub(\App\Service\EsyMailDnsService::class);
|
||||
$esyMailService->method('checkDnsEsyMail')->willReturn(['ok' => true]);
|
||||
$esyMailService->method('checkDnsEsyMailer')->willReturn(['ok' => false]);
|
||||
|
||||
@@ -1240,7 +1240,7 @@ class ClientsControllerTest extends TestCase
|
||||
$this->createStub(\App\Service\OvhService::class),
|
||||
$this->createStub(\App\Service\CloudflareService::class),
|
||||
$this->createStub(\App\Service\DnsCheckService::class),
|
||||
$this->createStub(\App\Service\EsyMailService::class),
|
||||
$this->createStub(\App\Service\EsyMailDnsService::class),
|
||||
$this->createStub(\Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface::class),
|
||||
$this->createStub(MailerService::class),
|
||||
$this->createStub(Environment::class),
|
||||
|
||||
Reference in New Issue
Block a user