Example #1
0
 /**
  * @param Args         $args
  * @param ClassBinding $bindingToUpdate
  *
  * @return ClassBinding
  */
 private function getUpdatedClassBinding(Args $args, ClassBinding $bindingToUpdate)
 {
     $className = $bindingToUpdate->getClassName();
     $typeName = $bindingToUpdate->getTypeName();
     $bindingParams = $bindingToUpdate->getParameterValues();
     if ($args->isOptionSet('class')) {
         $className = $args->getOption('class');
     }
     if ($args->isOptionSet('type')) {
         $typeName = $args->getOption('type');
     }
     $this->parseParams($args, $bindingParams);
     $this->unsetParams($args, $bindingParams);
     return new ClassBinding($className, $typeName, $bindingParams, $bindingToUpdate->getUuid());
 }
 public function testCreateWithClassName()
 {
     $binding = new ClassBinding(__CLASS__, Foo::clazz);
     $this->assertSame(__CLASS__, $binding->getClassName());
 }