Fixed PHPUnit tests.

This commit is contained in:
Jan Böhmer 2020-04-16 16:25:40 +02:00
parent a39f816422
commit ea0d72bfbb

View file

@ -22,6 +22,7 @@ namespace App\Tests\Services\LabelSystem\PlaceholderProviders;
use App\Entity\Contracts\TimeStampableInterface; use App\Entity\Contracts\TimeStampableInterface;
use App\Services\LabelSystem\PlaceholderProviders\GlobalProviders; use App\Services\LabelSystem\PlaceholderProviders\GlobalProviders;
use App\Services\LabelSystem\PlaceholderProviders\TimestampableElementProvider;
use DateTime; use DateTime;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
@ -35,7 +36,7 @@ class TimestampableElementProviderTest extends WebTestCase
public function setUp(): void public function setUp(): void
{ {
self::bootKernel(); self::bootKernel();
$this->service = self::$container->get(GlobalProviders::class); $this->service = self::$container->get(TimestampableElementProvider::class);
$this->target = new class implements TimeStampableInterface { $this->target = new class implements TimeStampableInterface {
/** /**
@ -58,9 +59,11 @@ class TimestampableElementProviderTest extends WebTestCase
public function dataProvider(): array public function dataProvider(): array
{ {
$formatted = \IntlDateFormatter::formatObject(new \DateTime('2000-01-01'), \IntlDateFormatter::SHORT);
return [ return [
['2000-01-01', '%%LAST_MODIFIED%%'], [$formatted, '%%LAST_MODIFIED%%'],
['2000-01-01', '%%CREATION_DATE%%'], [$formatted, '%%CREATION_DATE%%'],
]; ];
} }