<?php

namespace Concrete\Tests\Database\EntityManager\Driver;

use Concrete\Core\Database\EntityManager\Driver\Driver;
use Doctrine\ORM\Mapping\Driver\YamlDriver;
use Concrete\Tests\TestCase;

/**
 * DriverTest.
 *
 * @author Markus Liechti <markus@liechti.io>
 * @group orm_setup
 */
class DriverTest extends TestCase
{
    /**
     * @var \Concrete\Core\Database\EntityManager\Driver\Driver
     */
    protected $driver;

    public function setUp():void
    {
        parent::setUp();
        $driver = new YamlDriver('config/yaml');
        $this->driver = new Driver('Test\Namespace', $driver);
    }

    /**
     * @covers \Concrete\Core\Database\EntityManager\Driver\Driver::getDriver
     */
    public function testGetDriver()
    {
        $this->assertInstanceOf('Doctrine\Persistence\Mapping\Driver\MappingDriver', $this->driver->getDriver());
    }

    /**
     * @covers \Concrete\Core\Database\EntityManager\Driver\Driver::getNamespace
     */
    public function testGetNamespace()
    {
        $this->assertEquals('Test\Namespace', $this->driver->getNamespace());
    }
}
