infinito/application/symfony/tests/Integration/Domain/ParameterManagement/Parameter/VersionParameterIntegrationTest.php
2019-03-28 21:20:21 +01:00

30 lines
1018 B
PHP

<?php
namespace tests\Integration\Domain\ParameterManagement\Parameter;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\Component\Validator\Validator\ValidatorInterface;
use Infinito\Domain\ParameterManagement\Parameter\VersionParameter;
/**
* @author kevinfrantz
*/
class VersionParameterIntegrationTest extends KernelTestCase
{
public function testValidation()
{
self::bootKernel();
$validator = self::$container->get(ValidatorInterface::class);
$versionParameter = new VersionParameter();
$versionParameter->setValue(123);
$errors = $validator->validate($versionParameter)->count();
$this->assertEquals(0, $errors);
$versionParameter->setValue(null);
$errors = $validator->validate($versionParameter)->count();
$this->assertEquals(0, $errors);
$versionParameter->setValue('abc');
$errors = $validator->validate($versionParameter)->count();
$this->assertGreaterThan(0, $errors);
}
}