for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
/*
* This file is part of the Sonata Project package.
*
* (c) Thomas Rabaix <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sonata\DoctrineORMAdminBundle\Tests\Filter;
use PHPUnit\Framework\TestCase;
use Sonata\DoctrineORMAdminBundle\Filter\EmptyFieldFilter;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
class EmptyFieldFilterTest extends TestCase
{
public function testRenderSettings(): void
$filter = new EmptyFieldFilter();
$filter->initialize('field_name', [
'field_options' => ['class' => 'FooBar'],
]);
$options = $filter->getRenderSettings()[1];
$this->assertSame(ChoiceType::class, $options['field_type']);
$this->assertSame([
'label_type_empty' => EmptyFieldFilter::TYPE_EMPTY,
'label_type_not_empty' => EmptyFieldFilter::TYPE_NOT_EMPTY,
], $options['field_options']['choices']);
}