Пример #1
0
 /**
  * @param  string  $pathPart
  * @param  string  $constantName
  * @test
  * @dataProvider  getWithAdditionalConstants
  */
 public function additionalPathTypesShouldBeBound($pathPart, $constantName)
 {
     $binder = new Binder();
     $runtime = new Runtime($this->environment);
     $runtime->addPathType('user')->configure($binder, $this->root->url());
     assert($binder->getInjector()->getConstant($constantName), equals($this->getProjectPath($pathPart)));
 }
Пример #2
0
 /**
  * creates list of bindings from given class
  *
  * @internal  must not be used by applications
  * @param   string  $className    full qualified class name of class to create an instance of
  * @return  \stubbles\ioc\module\BindingModule[]
  * @since   1.3.0
  */
 protected static function getBindingsForApp(string $className) : array
 {
     $bindings = method_exists($className, '__bindings') ? $className::__bindings() : [];
     if (!Runtime::initialized()) {
         $bindings[] = static::runtime();
     }
     return $bindings;
 }