示例#1
0
 public function testRegister()
 {
     $container = new ServiceContainer();
     $container->register(new CoreProvider($container));
     $container->register(new ConsumerProvider($container));
     $this->assertArrayHasKey('consumer', $container);
 }
示例#2
0
 public function testRegister()
 {
     $container = new ServiceContainer();
     $container->register(new ServiceProvider($container));
     $this->assertInstanceOf('\\Pimple', $container['core']);
     $this->assertInstanceOf('Symfony\\Component\\EventDispatcher\\EventDispatcher', $container['core']['dispatcher']);
 }
示例#3
0
 public function testRegister()
 {
     $config = new Config();
     $container = new ServiceContainer();
     $container->setConfig($config);
     $params = array('dbname' => 'DBNAME', 'user' => 'USER', 'password' => 'PWD', 'host' => '', 'driver' => 'oci8');
     $config = new Configuration();
     $connection = DriverManager::getConnection($params, $config);
     $values = array('doctrine.connection' => $connection);
     $container->register(new ServiceCommandProvider(), $values);
     $this->assertEquals($connection, $container['doctrine.connection']);
 }
示例#4
0
 public function testRegister()
 {
     $container = new ServiceContainer();
     $container->setConfig(new Config());
     $container->register(new ServiceProvider());
     // collectors
     $this->assertInstanceOf('Itkg\\Debug\\DataCollector\\CacheDataCollector', $container['debug']['collector.cache']);
     $this->assertInstanceOf('Itkg\\Debug\\DataCollector\\ConfigDataCollector', $container['debug']['collector.config']);
     $this->assertInstanceOf('Itkg\\Debug\\DataCollector\\RouteDataCollector', $container['debug']['collector.route']);
     $this->assertInstanceOf('Itkg\\Debug\\DataCollector\\DatabaseDataCollector', $container['debug']['collector.db']);
     // bar
     $this->assertInstanceOf('DebugBar\\StandardDebugBar', $container['debug']['bar']);
     // renderer
     $this->assertInstanceOf('DebugBar\\JavascriptRenderer', $container['debug']['renderer']);
 }
示例#5
0
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  */
 protected function setUp()
 {
     $this->container = new Servicecontainer();
     $this->container->setApp(new Application())->setConfig(new Config());
     $this->container->register(new ServiceCommandProvider());
 }