Implemented RequestedEntityServiceIntegrationTest

This commit is contained in:
Kevin Frantz
2019-02-15 22:06:14 +01:00
parent 031bff568a
commit c0113ecd32
4 changed files with 62 additions and 14 deletions

View File

@@ -0,0 +1,8 @@
# Domain Unit Tests
## Conventions
### Service Tests
A test for an service:
- MUST extend KernelTest
- MUST test the actual injection
- MUST be an integration test

View File

@@ -0,0 +1,37 @@
<?php
namespace tests\Integration\Domain\RequestManagement\Entity;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use App\Domain\RequestManagement\Entity\RequestedEntityServiceInterface;
use App\Domain\RequestManagement\Entity\RequestedEntityService;
use App\Entity\Source\AbstractSource;
/**
* @author kevinfrantz
*/
class RequestedEntityServiceIntegrationTest extends KernelTestCase
{
/**
* @var RequestedEntityServiceInterface
*/
private $requestedEntityService;
/**
* {@inheritdoc}
*
* @see \PHPUnit\Framework\TestCase::setUp()
*/
public function setUp(): void
{
self::bootKernel();
$this->requestedEntityService = self::$container->get(RequestedEntityService::class);
}
public function testClassAccessors(): void
{
$class = AbstractSource::class;
$this->assertNull($this->requestedEntityService->setClass($class));
$this->assertEquals($class, $this->requestedEntityService->getClass());
}
}