for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace LAG\AdminBundle\Tests\AdminBundle\Field;
use DateTime;
use LAG\AdminBundle\Field\Field\Date;
use LAG\AdminBundle\Tests\AdminTestBase;
class DateTest extends AdminTestBase
{
public function testRender()
$linkField = new Date('my-field');
$this->setPrivateProperty($linkField, 'options', [
'format' => 'd/m/Y',
]);
$now = new DateTime();
$content = $linkField->render($now);
$this->assertEquals($now->format('d/m/Y'), $content);
}
public function testRenderInvalidValue()
$this->assertExceptionRaised(\Exception::class, function () use ($linkField) {
$linkField->render('2017-10-05');
});