Ejemplo n.º 1
0
Archivo: Dug.php Proyecto: label305/dug
 /**
  * @param array $path
  * @return Source|null
  */
 public function sourceForPath(array $path)
 {
     foreach ($this->sources as $source) {
         if (RouteMatcher::matches($source, $path)) {
             return $source;
         }
     }
     return null;
 }
Ejemplo n.º 2
0
 public function testRegexNotValid()
 {
     /* Given */
     $source = Source::build(['tracks', '/[0-9]+/'], function () {
     });
     /* When */
     $result = RouteMatcher::matches($source, ['tracks', 'length']);
     /* Then */
     assertThat($result, is(false));
 }