Implemented tests to keep code coverage high

This commit is contained in:
Kevin Frantz 2018-11-04 14:36:10 +01:00
parent 6bf17f5935
commit 7e35def4c3
3 changed files with 125 additions and 0 deletions

View 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;
use App\Form\NameSourceType;
/**
* This class just exists to keep the code coverage high.
*
* @todo Implement better tests!
*
* @author kevinfrantz
*/
class NameSourceTypeTest extends TestCase
{
/**
* @var AbstractType
*/
protected $type;
public function setUp(): void
{
$this->type = new NameSourceType();
}
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));
}
}

View 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;
use App\Form\UserSourceType;
/**
* This class just exists to keep the code coverage high.
*
* @todo Implement better tests!
*
* @author kevinfrantz
*/
class UserSourceTypeTest extends TestCase
{
/**
* @var AbstractType
*/
protected $type;
public function setUp(): void
{
$this->type = new UserSourceType();
}
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));
}
}

View File

@ -0,0 +1,43 @@
<?php
namespace Tests\Unit\Form;
use PHPUnit\Framework\TestCase;
use App\Form\AbstractType;
use Symfony\Component\OptionsResolver\OptionsResolver;
use App\Form\UserType;
use Symfony\Component\Form\FormBuilder;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\Form\FormFactoryInterface;
/**
* This class just exists to keep the code coverage high.
*
* @todo Implement better tests!
*
* @author kevinfrantz
*/
class UserTypeTest extends TestCase
{
/**
* @var AbstractType
*/
protected $type;
public function setUp(): void
{
$this->type = new UserType();
}
public function testBuildForm(): void
{
$builder = new FormBuilder(null, null, $this->createMock(EventDispatcherInterface::class), $this->createMock(FormFactoryInterface::class));
$this->assertNull($this->type->buildForm($builder, []));
}
public function testConfigureOptions(): void
{
$resolver = $this->createMock(OptionsResolver::class);
$this->assertNull($this->type->configureOptions($resolver));
}
}