mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-01 12:33:49 +00:00
apply more cs rules for php-cs
This commit is contained in:
@@ -20,6 +20,7 @@ use Symfony\Component\Clock\MockClock;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* @coversNothing
|
||||
*/
|
||||
class CollateAddressWithReferenceOrPostalCodeCronJobTest extends TestCase
|
||||
|
@@ -18,6 +18,7 @@ use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* @coversNothing
|
||||
*/
|
||||
class CollateAddressWithReferenceOrPostalCodeTest extends KernelTestCase
|
||||
|
@@ -12,7 +12,6 @@ declare(strict_types=1);
|
||||
namespace Chill\MainBundle\Tests\Services\AddressGeographicalUnit;
|
||||
|
||||
use Chill\MainBundle\Entity\CronJobExecution;
|
||||
use DateTimeImmutable;
|
||||
use Doctrine\DBAL\Connection;
|
||||
use Prophecy\PhpUnit\ProphecyTrait;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
||||
@@ -20,6 +19,7 @@ use Symfony\Component\Clock\MockClock;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* @coversNothing
|
||||
*/
|
||||
final class RefreshAddressToGeographicalUnitMaterializedViewCronJobTest extends KernelTestCase
|
||||
@@ -32,13 +32,13 @@ final class RefreshAddressToGeographicalUnitMaterializedViewCronJobTest extends
|
||||
// 10 + 5 executions
|
||||
$job = new \Chill\MainBundle\Service\AddressGeographicalUnit\RefreshAddressToGeographicalUnitMaterializedViewCronJob(
|
||||
$this->prophesize(Connection::class)->reveal(),
|
||||
new MockClock(new DateTimeImmutable('2023-07-01T00:00:00'))
|
||||
new MockClock(new \DateTimeImmutable('2023-07-01T00:00:00'))
|
||||
);
|
||||
|
||||
$hoursAgo23 = new CronJobExecution($job->getKey());
|
||||
$hoursAgo23->setLastStart(new DateTimeImmutable('2023-06-30T01:00:00'));
|
||||
$hoursAgo23->setLastStart(new \DateTimeImmutable('2023-06-30T01:00:00'));
|
||||
$hoursAgo25 = new CronJobExecution($job->getKey());
|
||||
$hoursAgo25->setLastStart(new DateTimeImmutable('2023-06-29T23:00:00'));
|
||||
$hoursAgo25->setLastStart(new \DateTimeImmutable('2023-06-29T23:00:00'));
|
||||
|
||||
$executedForFirstTime = $executedAfter23 = $executedAfter25 = 0;
|
||||
|
||||
@@ -71,7 +71,7 @@ final class RefreshAddressToGeographicalUnitMaterializedViewCronJobTest extends
|
||||
);
|
||||
|
||||
$lastExecution = new CronJobExecution($job->getKey());
|
||||
$lastExecution->setLastStart(new DateTimeImmutable('2 days ago'));
|
||||
$lastExecution->setLastStart(new \DateTimeImmutable('2 days ago'));
|
||||
|
||||
$this->assertIsBool($job->canRun($lastExecution));
|
||||
|
||||
|
@@ -20,6 +20,7 @@ use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* @coversNothing
|
||||
*/
|
||||
final class AddressReferenceBaseImporterTest extends KernelTestCase
|
||||
@@ -46,7 +47,7 @@ final class AddressReferenceBaseImporterTest extends KernelTestCase
|
||||
public function testImportAddress(): void
|
||||
{
|
||||
$postalCode = (new PostalCode())
|
||||
->setRefPostalCodeId($postalCodeId = '1234' . uniqid())
|
||||
->setRefPostalCodeId($postalCodeId = '1234'.uniqid())
|
||||
->setPostalCodeSource('testing')
|
||||
->setCode('TEST456')
|
||||
->setName('testing');
|
||||
|
@@ -11,9 +11,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace Services\Import;
|
||||
|
||||
use Chill\MainBundle\Doctrine\Model\Point;
|
||||
use Chill\MainBundle\Entity\Address;
|
||||
use Chill\MainBundle\Entity\AddressReference;
|
||||
use Chill\MainBundle\Entity\PostalCode;
|
||||
use Chill\MainBundle\Repository\AddressReferenceRepository;
|
||||
use Chill\MainBundle\Repository\CountryRepository;
|
||||
@@ -24,6 +22,7 @@ use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* @coversNothing
|
||||
*/
|
||||
class AddressToReferenceMatcherTest extends KernelTestCase
|
||||
|
@@ -19,6 +19,7 @@ use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* @coversNothing
|
||||
*/
|
||||
final class GeographicalUnitBaseImporterTest extends KernelTestCase
|
||||
|
@@ -19,6 +19,7 @@ use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* @coversNothing
|
||||
*/
|
||||
final class PostalCodeBaseImporterTest extends KernelTestCase
|
||||
@@ -47,9 +48,9 @@ final class PostalCodeBaseImporterTest extends KernelTestCase
|
||||
{
|
||||
$this->importer->importCode(
|
||||
'BE',
|
||||
'tested with pattern ' . ($uniqid = uniqid()),
|
||||
'tested with pattern '.($uniqid = uniqid()),
|
||||
'12345',
|
||||
$refPostalCodeId = 'test' . uniqid(),
|
||||
$refPostalCodeId = 'test'.uniqid(),
|
||||
'test',
|
||||
50.0,
|
||||
5.0,
|
||||
@@ -59,7 +60,7 @@ final class PostalCodeBaseImporterTest extends KernelTestCase
|
||||
$this->importer->finalize();
|
||||
|
||||
$postalCodes = $this->postalCodeRepository->findByPattern(
|
||||
'with pattern ' . $uniqid,
|
||||
'with pattern '.$uniqid,
|
||||
$this->countryRepository->findOneBy(['countryCode' => 'BE'])
|
||||
);
|
||||
|
||||
@@ -72,7 +73,7 @@ final class PostalCodeBaseImporterTest extends KernelTestCase
|
||||
|
||||
$this->importer->importCode(
|
||||
'BE',
|
||||
'tested with adapted pattern ' . ($uniqid = uniqid()),
|
||||
'tested with adapted pattern '.($uniqid = uniqid()),
|
||||
'12345',
|
||||
$refPostalCodeId,
|
||||
'test',
|
||||
@@ -84,7 +85,7 @@ final class PostalCodeBaseImporterTest extends KernelTestCase
|
||||
$this->importer->finalize();
|
||||
|
||||
$postalCodes = $this->postalCodeRepository->findByPattern(
|
||||
'with pattern ' . $uniqid,
|
||||
'with pattern '.$uniqid,
|
||||
$this->countryRepository->findOneBy(['countryCode' => 'BE'])
|
||||
);
|
||||
|
||||
|
@@ -18,6 +18,7 @@ use Symfony\Component\Routing\RouteCollection;
|
||||
* This class provide functional test for MenuComposer.
|
||||
*
|
||||
* @internal
|
||||
*
|
||||
* @coversNothing
|
||||
*/
|
||||
final class MenuComposerTest extends KernelTestCase
|
||||
|
@@ -13,12 +13,11 @@ namespace Services\RollingDate;
|
||||
|
||||
use Chill\MainBundle\Service\RollingDate\RollingDate;
|
||||
use Chill\MainBundle\Service\RollingDate\RollingDateConverter;
|
||||
use DateTime;
|
||||
use DateTimeImmutable;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* @coversNothing
|
||||
*/
|
||||
final class RollingDateConverterTest extends TestCase
|
||||
@@ -63,7 +62,7 @@ final class RollingDateConverterTest extends TestCase
|
||||
|
||||
public function testConversionFixedDate()
|
||||
{
|
||||
$rollingDate = new RollingDate(RollingDate::T_FIXED_DATE, new DateTimeImmutable('2022-01-01'));
|
||||
$rollingDate = new RollingDate(RollingDate::T_FIXED_DATE, new \DateTimeImmutable('2022-01-01'));
|
||||
|
||||
$this->assertEquals(
|
||||
'2022-01-01',
|
||||
@@ -78,7 +77,7 @@ final class RollingDateConverterTest extends TestCase
|
||||
$actual = $this->converter->convert($rollingDate);
|
||||
|
||||
$this->assertEquals(
|
||||
(int) (new DateTimeImmutable('now'))->format('Y') - 1,
|
||||
(int) (new \DateTimeImmutable('now'))->format('Y') - 1,
|
||||
(int) $actual->format('Y')
|
||||
);
|
||||
$this->assertEquals(1, (int) $actual->format('m'));
|
||||
@@ -90,11 +89,11 @@ final class RollingDateConverterTest extends TestCase
|
||||
*/
|
||||
public function testConvertOnPivotDate(string $roll, string $expectedDateTime, string $format)
|
||||
{
|
||||
$pivot = DateTimeImmutable::createFromFormat('Y-m-d His', '2022-11-07 000000');
|
||||
$pivot = \DateTimeImmutable::createFromFormat('Y-m-d His', '2022-11-07 000000');
|
||||
$rollingDate = new RollingDate($roll, null, $pivot);
|
||||
|
||||
$this->assertEquals(
|
||||
DateTime::createFromFormat($format, $expectedDateTime),
|
||||
\DateTime::createFromFormat($format, $expectedDateTime),
|
||||
$this->converter->convert($rollingDate)
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user