public static function createServiceProvider($useManyToMany) { self::$fileProcessor = new NullFileProcessor(); $app = self::createAppAndDB($useManyToMany); $crudServiceProvider = new ServiceProvider(); $dataFactory = new MySQLDataFactory($app['db']); $crudFile = __DIR__ . '/../' . ($useManyToMany ? 'crudManyToMany.yml' : 'crud.yml'); $crudServiceProvider->init($dataFactory, $crudFile, self::$fileProcessor, true, $app); $userSetup = new UserSetup(); $userSetup->addEvents($crudServiceProvider->getData('user')); return $crudServiceProvider; }
public function testSetLocale() { $serviceProvider = new ServiceProvider(); $app = new Application(); $serviceProvider->init($this->dataFactory, $this->crudFile, $this->fileProcessorMock, true, $app); $serviceProvider->setLocale('de'); $read = $serviceProvider->getData('library')->getDefinition()->getLocale(); $expected = 'de'; $this->assertSame($expected, $read); $read = $serviceProvider->getData('book')->getDefinition()->getLocale(); $this->assertSame($expected, $read); }