Example #1
0
 /**
  *
  */
 public function testMatch()
 {
     $template = new Template('/show-symbol/{symbol:[\\{|\\}]}/');
     $this->assertEquals('/show-symbol/(?P<symbol>[\\{|\\}])/', $template->getTemplateMatch());
     $this->assertFalse($template->match('test'));
     $this->assertFalse($template->match('/show-symbol/123/'));
     $result = $template->match('/show-symbol/{/', $data);
     $this->assertTrue($result);
     $this->assertArrayHasKey('symbol', $data);
     $this->assertEquals('{', $data['symbol']);
     $this->assertEquals('/show-symbol/{symbol}/', $template->getTemplateBuild());
 }