infinito/application/symfony/tests/Unit/Domain/Parameter/ParameterFactoryTest.php

34 lines
1.2 KiB
PHP
Raw Normal View History

2019-03-28 19:15:02 +01:00
<?php
namespace tests\Unit\Domain\Parameter;
2019-03-28 19:15:02 +01:00
use Infinito\Domain\Parameter\Parameter\VersionParameter;
2020-04-02 21:13:35 +02:00
use Infinito\Domain\Parameter\ParameterFactory;
2019-04-15 01:37:17 +02:00
use Infinito\Exception\Core\NotImplementedCoreException;
2020-04-02 21:13:35 +02:00
use PHPUnit\Framework\TestCase;
2019-03-28 19:15:02 +01:00
/**
* @author kevinfrantz
*/
class ParameterFactoryTest extends TestCase
{
2019-03-28 19:15:24 +01:00
public function testAllParameters(): void
{
2019-03-28 19:15:02 +01:00
$parameterFactory = new ParameterFactory();
$allParameters = $parameterFactory->getAllParameters();
$versionParameter = $allParameters->get('version');
$this->assertInstanceOf(VersionParameter::class, $versionParameter);
$this->assertEquals($versionParameter, $parameterFactory->getParameter('version'));
}
2019-03-28 22:17:59 +01:00
public function testGetParameter(): void
{
$parameterFactory = new ParameterFactory();
$versionParameter = $parameterFactory->getParameter('version');
$this->assertInstanceOf(VersionParameter::class, $versionParameter);
$this->assertEquals($versionParameter, $parameterFactory->getParameter('version'));
2019-04-15 01:37:17 +02:00
$this->expectException(NotImplementedCoreException::class);
2019-03-28 22:17:59 +01:00
$versionParameter = $parameterFactory->getParameter('blabalbal');
}
2019-03-28 19:15:02 +01:00
}