Beispiel #1
0
             t::get(function () {
                 echo 'get';
             });
             t::post(function () {
                 echo 'post';
             });
         });
         t::not_found(function () {
             echo 'no rules picked up';
         });
     });
     expect($gather)->to_be('post');
 });
 it("should register global functions when requested", function () {
     $gather = gather_info(function () {
         t::register_global_functions();
         if (function_exists('get')) {
             echo 'get()';
         }
     });
     expect($gather)->to_be('get()');
 });
 it("should allow labels to be qualified with a regex", function () {
     mimick_request('/user/1234', 'GET');
     $gather = gather_info(function () {
         t::get('/user/:userid', function () {
             echo 'alpha';
         }, array(':userid' => '/^[a-z]+$/i'));
         t::get('/user/:userid', function () {
             echo 'numerical';
         }, array(':userid' => '/^[0-9]+$/i'));