Example #1
0
 public function testWithoutValue()
 {
     $copy = $this->struct->withoutValue('blue');
     $this->assertNotSame($this->struct, $copy);
     $this->assertTrue($this->struct->hasValue('blue'));
     $this->assertFalse($copy->hasValue('blue'));
     // If the value does not exist, nothing changes
     $same = $copy->withoutValue('blue');
     $this->assertSame($copy, $same);
 }
Example #2
0
 /**
  * @inheritDoc
  *
  * @throws ConfigurationException
  *  If $classes does not implement the correct interface.
  */
 protected function assertValid(array $classes)
 {
     parent::assertValid($classes);
     foreach ($classes as $config) {
         if (!is_subclass_of($config, ConfigurationInterface::class)) {
             throw ConfigurationException::invalidClass($config);
         }
     }
 }
Example #3
0
 /**
  * @inheritDoc
  *
  * @throws ResponderException
  *  If $classes does not implement the correct interface.
  */
 protected function assertValid(array $classes)
 {
     parent::assertValid($classes);
     foreach ($classes as $responder) {
         if (!is_subclass_of($responder, ResponderInterface::class)) {
             throw ResponderException::invalidClass($responder);
         }
     }
 }
Example #4
0
 /**
  * @inheritDoc
  *
  * @throws MiddlewareException
  *  If $classes does not conform to type expectations.
  */
 protected function assertValid(array $classes)
 {
     parent::assertValid($classes);
     foreach ($classes as $middleware) {
         if (!(is_callable($middleware) || method_exists($middleware, '__invoke'))) {
             throw MiddlewareException::notInvokable($middleware);
         }
     }
 }