39 lines
1.2 KiB
PHP
39 lines
1.2 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace RprtCli\Tests\Unit\YoutrackRestApi;
|
|
|
|
use DI\ContainerBuilder;
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
/**
|
|
* Test the entity manager service and system.
|
|
*/
|
|
class EntityManagerTest extends TestCase {
|
|
|
|
/**
|
|
* Run report and invoice command with file option parameter. Check if pdf was generated.
|
|
*/
|
|
public function testExecute()
|
|
{
|
|
$builder = new ContainerBuilder();
|
|
$builder->addDefinitions(__DIR__ . '/../../test-dependencies.php');
|
|
$container = $builder->build();
|
|
$entityManagerService = $container->get('youtrack.entity_manager');
|
|
// Instance of EntityMangerInterface;
|
|
// $this->assertInstanceOf('EntityManagerInterface', $entityManagerService);
|
|
$definitions = $entityManagerService->list();
|
|
var_dump($definitions);
|
|
$this->assertCount(3, $definitions);
|
|
$entities = ['project', 'issue', 'work_item'];
|
|
foreach ($entities as $entity) {
|
|
$this->assertArrayHasKey($entity, $definitions, 'Check that key exists in entity types definitions.');
|
|
}
|
|
// list method returns definitions: project, issue, worktItem
|
|
// Check one definition, compare.
|
|
|
|
}
|
|
|
|
}
|