Exemple #1
0
 /**
  * Test that a valid container is created
  */
 public function testCreateValidContainer()
 {
     $route = '/test';
     $config = ['name' => 'foo'];
     $container = new \Psecio\Invoke\RouteContainer($route, $config);
     $routeInstance = $container->getRoute();
     $this->assertTrue($routeInstance instanceof \Psecio\Invoke\MatchInstance);
     $this->assertEquals(['route' => '/test'], $routeInstance->getConfig());
 }
Exemple #2
0
 /**
  * Test that an invalid match is triggered when the value
  * 	does not exist
  */
 public function testMissingValueParameterMatch()
 {
     $config = ['data' => [[]]];
     $route = new \Psecio\Invoke\RouteContainer('/foo/bar', []);
     $route->setParams(['foo' => 'test2']);
     $this->data->setRoute($route);
     $hasParam = new HasParameters($config);
     $this->assertFalse($hasParam->evaluate($this->data));
 }