예제 #1
0
파일: Dug.php 프로젝트: 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;
 }
예제 #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));
 }