コード例 #1
0
ファイル: FluentDriverTest.php プロジェクト: guiwoda/fluent
 public function test_allow_other_fluent_implementations()
 {
     $driver = new FluentDriver();
     $driver->setFluentFactory(function (ClassMetadata $metadata) {
         return new CustomBuilder(new ClassMetadataBuilder($metadata));
     });
     $mapping = $this->getMock(EntityMapping::class);
     $mapping->expects($this->once())->method('map')->with($this->isInstanceOf(CustomBuilder::class));
     $driver->getMappers()->addMapper('fake', new EntityMapper($mapping));
     $driver->loadMetadataForClass('fake', new ClassMetadataInfo('fake'));
 }