Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
44 lines (35 sloc) 1.3 KB
<?php
namespace Doctrine\Tests\Common\Persistence\Mapping;
use Doctrine\Tests\DoctrineTestCase;
use Doctrine\Common\Persistence\Mapping\Driver\StaticPHPDriver;
class StaticPHPDriverTest extends DoctrineTestCase
{
public function testLoadMetadata()
{
$metadata = $this->getMock('Doctrine\Common\Persistence\Mapping\ClassMetadata');
$metadata->expects($this->once())->method('getFieldNames');
$driver = new StaticPHPDriver(array(__DIR__));
$driver->loadMetadataForClass(__NAMESPACE__ . '\\TestEntity', $metadata);
}
public function testGetAllClassNames()
{
$driver = new StaticPHPDriver(array(__DIR__));
$classNames = $driver->getAllClassNames();
$this->assertContains(
'Doctrine\Tests\Common\Persistence\Mapping\TestEntity', $classNames);
}
public function testGetAllClassNamesFiltered()
{
$driver = new StaticPHPDriver(array(__DIR__));
$classNames = $driver->getAllClassNames(array('Doctrine\Tests\Common\Persistence\Mapping\TestEntity'));
$this->assertCount(1, $classNames);
$this->assertContains('Doctrine\Tests\Common\Persistence\Mapping\TestEntity', $classNames);
}
}
class TestEntity
{
static public function loadMetadata($metadata)
{
$metadata->getFieldNames();
}
}
Something went wrong with that request. Please try again.