public function testMongoDBDriver() { $this->resource = new LocaleResource($driver = LocaleResource::DRIVER_DOCTRINE_MONGODB); $this->assertSame('locale', $this->resource->getName()); $this->assertSame($driver, $this->resource->getDriver()); $this->assertSame(realpath(__DIR__ . '/../../../../Component/Locale/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(Factory::class, $this->resource->getFactory()); $this->assertSame(DoctrineMongoDBRepository::class, $this->resource->getRepository()); $this->assertSame(LocaleType::class, $this->resource->getForm()); $this->assertSame(DoctrineMongoDBLocaleChoiceType::class, $this->resource->getChoiceForm()); $this->assertSame(Controller::class, $this->resource->getController()); $this->assertSame(DomainManager::class, $this->resource->getDomainManager()); $this->assertSame('code', $this->resource->getLabelPropertyPath()); $this->assertSame('code', $this->resource->getIdPropertyPath()); $this->assertEmpty($this->resource->getRelations()); }
public function testMongoDBDriver() { $this->resource = new LocaleResource($this->bundlePath, $driver = LocaleResource::DRIVER_DOCTRINE_MONGODB); $this->assertSame('locale', $this->resource->getName()); $this->assertSame($driver, $this->resource->getDriver()); $this->assertSame($this->bundlePath . '/Resources/config/resources', $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(Factory::class, $this->resource->getFactory()); $this->assertSame(DoctrineMongoDBRepository::class, $this->resource->getRepository()); $this->assertSame(LocaleType::class, $this->resource->getForm()); $this->assertSame(DoctrineMongoDBLocaleChoiceType::class, $this->resource->getChoiceForm()); $this->assertSame(Controller::class, $this->resource->getController()); $this->assertSame(DomainManager::class, $this->resource->getDomainManager()); $this->assertSame('code', $this->resource->getLabelPropertyPath()); $this->assertSame('code', $this->resource->getIdPropertyPath()); $this->assertNull($this->resource->getTranslation()); }