mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-01-10 06:27:24 +01:00
Implemented test for AbstractType to keep code coverage high
This commit is contained in:
parent
e28f17b88e
commit
6bf17f5935
9
application/src/Form/AbstractType.php
Normal file
9
application/src/Form/AbstractType.php
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Form;
|
||||||
|
|
||||||
|
use Symfony\Component\Form\AbstractType as AbstractSymfonyType;
|
||||||
|
|
||||||
|
class AbstractType extends AbstractSymfonyType
|
||||||
|
{
|
||||||
|
}
|
@ -2,11 +2,10 @@
|
|||||||
|
|
||||||
namespace App\Form;
|
namespace App\Form;
|
||||||
|
|
||||||
use Symfony\Component\Form\AbstractType;
|
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||||
use App\Entity\Source\NameSource;
|
use App\Entity\Source\Data\NameSource;
|
||||||
|
|
||||||
class NameSourceType extends AbstractType
|
class NameSourceType extends AbstractType
|
||||||
{
|
{
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
namespace App\Form;
|
namespace App\Form;
|
||||||
|
|
||||||
use App\Entity\User;
|
use App\Entity\User;
|
||||||
use Symfony\Component\Form\AbstractType;
|
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
|
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
namespace App\Form;
|
namespace App\Form;
|
||||||
|
|
||||||
use App\Entity\User;
|
use App\Entity\User;
|
||||||
use Symfony\Component\Form\AbstractType;
|
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||||
|
41
application/tests/Unit/Form/AbstractTypeTest.php
Normal file
41
application/tests/Unit/Form/AbstractTypeTest.php
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\Unit\Form;
|
||||||
|
|
||||||
|
use PHPUnit\Framework\TestCase;
|
||||||
|
use App\Form\AbstractType;
|
||||||
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class just exists to keep the code coverage high.
|
||||||
|
*
|
||||||
|
* @todo Implement better tests!
|
||||||
|
*
|
||||||
|
* @author kevinfrantz
|
||||||
|
*/
|
||||||
|
class AbstractTypeTest extends TestCase
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @var AbstractType
|
||||||
|
*/
|
||||||
|
protected $type;
|
||||||
|
|
||||||
|
public function setUp(): void
|
||||||
|
{
|
||||||
|
$this->type = new class() extends AbstractType {
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testBuildForm(): void
|
||||||
|
{
|
||||||
|
$builder = $this->createMock(FormBuilderInterface::class);
|
||||||
|
$this->assertNull($this->type->buildForm($builder, []));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testConfigureOptions(): void
|
||||||
|
{
|
||||||
|
$resolver = $this->createMock(OptionsResolver::class);
|
||||||
|
$this->assertNull($this->type->configureOptions($resolver));
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user