Rajout de doctrine/orm
[zf2.biz/galerie.git] / vendor / doctrine / common / tests / Doctrine / Tests / Common / Persistence / Mapping / StaticPHPDriverTest.php
1 <?php
2
3 namespace Doctrine\Tests\Common\Persistence\Mapping;
4
5 use Doctrine\Tests\DoctrineTestCase;
6 use Doctrine\Common\Persistence\Mapping\Driver\StaticPHPDriver;
7
8 class StaticPHPDriverTest extends DoctrineTestCase
9 {
10     public function testLoadMetadata()
11     {
12         $metadata = $this->getMock('Doctrine\Common\Persistence\Mapping\ClassMetadata');
13         $metadata->expects($this->once())->method('getFieldNames');
14
15         $driver = new StaticPHPDriver(array(__DIR__));
16         $driver->loadMetadataForClass(__NAMESPACE__ . '\\TestEntity', $metadata);
17     }
18
19     public function testGetAllClassNames()
20     {
21         $driver = new StaticPHPDriver(array(__DIR__));
22         $classNames = $driver->getAllClassNames();
23
24         $this->assertContains(
25             'Doctrine\Tests\Common\Persistence\Mapping\TestEntity', $classNames);
26     }
27 }
28
29 class TestEntity
30 {
31     static public function loadMetadata($metadata)
32     {
33         $metadata->getFieldNames();
34     }
35 }