Ejemplo n.º 1
0
 /**
  * Set container dependencies
  */
 protected function setContainerDependencies()
 {
     $this->container->service(TestServiceClass::class, ['dependency1' => TestModuleClass::class, 'arrayParam' => [1, 2, 3], 'stringParam' => 'I am string'], $this->testServiceAlias);
     $this->container->set(TestModuleClass::class, ['dependency1' => OtherTestClass::class, 'dependency2' => OtherSecondTestClass::class, 'arrayParam' => [1, 2, 3], 'stringParam' => 'I am string']);
     $this->container->set(OtherTestClass::class, ['dependency1' => OtherThirdTestClass::class, 'arrayParam' => [2, 1, 2, 3], 'stringParam' => 'I am string2']);
     $this->container->set(OtherThirdTestClass::class, ['dependency1' => OtherSecondTestClass::class]);
     $this->container->set(OtherSecondTestClass::class, []);
 }
Ejemplo n.º 2
0
 public function testGetWithDelegateNotExistingDependency()
 {
     $this->expectException(ClassNotFoundException::class);
     $delegate = new Container();
     $delegate->set(TestCase::class);
     $this->container->delegate($delegate);
     $this->setProperty('logicCallable', $this->container, [$this, 'dependencyResolver']);
     $this->container->get(TestCase::class);
 }