2019-03-28 18:17:06 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace tests\Integration\Domain\ParameterManagement\Parameter;
|
|
|
|
|
2019-03-28 21:20:21 +01:00
|
|
|
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
|
|
|
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
|
|
|
use Infinito\Domain\ParameterManagement\Parameter\VersionParameter;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @author kevinfrantz
|
|
|
|
*/
|
|
|
|
class VersionParameterIntegrationTest extends KernelTestCase
|
2019-03-28 18:17:06 +01:00
|
|
|
{
|
2019-03-28 21:20:21 +01:00
|
|
|
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);
|
|
|
|
}
|
2019-03-28 18:17:06 +01:00
|
|
|
}
|