Пример #1
0
 public function testMongoDBDriver()
 {
     $this->resource = new LocaleResource($this->controller, $driver = LocaleResource::DRIVER_DOCTRINE_MONGODB);
     $this->assertSame('locale', $this->resource->getName());
     $this->assertSame($driver, $this->resource->getDriver());
     $this->assertSame(realpath(__DIR__ . '/../../Resources/Doctrine'), $this->resource->getDriverMappingPath());
     $this->assertSame(LocaleResource::DRIVER_MAPPING_FORMAT_XML, $this->resource->getDriverMappingFormat());
     $this->assertSame('default', $this->resource->getDriverManager());
     $this->assertSame([LocaleInterface::class], $this->resource->getInterfaces());
     $this->assertSame(Locale::class, $this->resource->getModel());
     $this->assertSame(DoctrineMongoDBRepository::class, $this->resource->getRepository());
     $this->assertSame(Factory::class, $this->resource->getFactory());
     $this->assertSame(LocaleType::class, $this->resource->getForm());
     $this->assertSame(DoctrineMongoDBLocaleChoiceType::class, $this->resource->getChoiceForm());
     $this->assertSame(DomainManager::class, $this->resource->getDomainManager());
     $this->assertSame($this->controller, $this->resource->getController());
     $this->assertSame('code', $this->resource->getLabelPropertyPath());
     $this->assertSame('code', $this->resource->getIdPropertyPath());
     $this->assertEmpty($this->resource->getRelations());
 }
Пример #2
0
 /**
  * @param string $driver
  */
 public function __construct($driver = self::DRIVER_DOCTRINE_ORM)
 {
     parent::__construct(Controller::class, $driver);
 }