Exemplo n.º 1
0
 public function testConfigurationCanConfigureBuilderDefinitionFromIni()
 {
     $this->markTestIncomplete('Builder not updated to new DI yet');
     $ini = new \Zend\Config\Ini(__DIR__ . '/_files/sample.ini', 'section-b');
     $config = new Configuration($ini->di);
     $di = new Di($config);
     $definition = $di->getDefinition();
     
     $this->assertTrue($definition->hasClass('My\DbAdapter'));
     $this->assertEquals('__construct', $definition->getInstantiator('My\DbAdapter'));
     $this->assertEquals(
         array('username' => null, 'password' => null),
         $definition->getInjectionMethodParameters('My\DbAdapter', '__construct')
         );
     
     $this->assertTrue($definition->hasClass('My\Mapper'));
     $this->assertEquals('__construct', $definition->getInstantiator('My\Mapper'));
     $this->assertEquals(
         array('dbAdapter' => 'My\DbAdapter'),
         $definition->getInjectionMethodParameters('My\Mapper', '__construct')
         );
     
     $this->assertTrue($definition->hasClass('My\Repository'));
     $this->assertEquals('__construct', $definition->getInstantiator('My\Repository'));
     $this->assertEquals(
         array('mapper' => 'My\Mapper'),
         $definition->getInjectionMethodParameters('My\Repository', '__construct')
         );
     
 }