示例#1
0
 /**
  * Create a persistor on which we will apply our tests.
  */
 public function setUp()
 {
     $virtual_structure = array('backbee' => array('Config' => array('config.yml' => \Symfony\Component\Yaml\Yaml::dump(array('parameters' => array('hello' => 'world'))))), 'repository' => array('Config' => array('config.yml' => \Symfony\Component\Yaml\Yaml::dump(array('parameters' => array('hello' => 'backbee'))))));
     vfsStream::setup('virtual_structure', 0777, $virtual_structure);
     // create basic manual application without context and environment
     $application = new ManualBBApplication();
     $application->setBase_Repository(vfsStream::url('virtual_structure') . '/repository');
     $application->setRepository($application->getBaseRepository());
     $application->setBB_Dir(vfsStream::url('virtual_structure') . '/backbee');
     $application->setConfig_Dir($application->getBBDir() . '/Config');
     $application->setBase_Dir(vfsStream::url('virtual_structure'));
     $bundleLoader = $this->getMockBuilder('BackBee\\Bundle\\BundleLoader')->disableOriginalConstructor()->getMock();
     $this->configurator = new Configurator($application, $bundleLoader);
     $this->persistor = new Persistor($application, $this->configurator);
     $this->application = $application;
     $application->setConfig(new Config($application->getConfigDir()));
     $this->configurator->configureApplicationConfig($application->getConfig());
 }
示例#2
0
 private function generateManualBBApplication($base_directory)
 {
     $application = new ManualBBApplication();
     $application->setBase_Repository($base_directory . '/repository');
     $application->setRepository($application->getBaseRepository());
     $application->setBB_Dir($base_directory . '/backbee');
     $application->setConfig_Dir($application->getBaseRepository());
     $application->setBase_Dir($base_directory);
     return $application;
 }