/**
  * Ensures that assertFulfills() accepts a type if the constraints list
  * is empty.
  */
 public function testAssertFulfillsAcceptsTypeIfListOfConstraintsIsEmpty()
 {
     $this->setExpectedException(null);
     $this->inspector->assertFulfills('ArrayObject', array());
 }
Ejemplo n.º 2
0
 /**
  * Creates an instance of the provided class.
  *
  * @param string $class That class that should be instantiated.
  * @param array(mixed) $constructorArguments Constructor arguments for creation.
  * @return object
  * @throws InvalidArgumentException If the provided class does not meet the type requirements.
  */
 public function create($class, array $constructorArguments = array())
 {
     $this->typeInspector->assertClass($class);
     $this->typeInspector->assertFulfills($class, $this->typeConstraints);
     return $this->createInstance(new ReflectionClass($class), $constructorArguments);
 }