Example #1
0
         expect($request->basePath())->toBe('');
         $request->basePath('/base/path/webroot');
         expect($request->basePath())->toBe('/base/path');
     });
 });
 describe("->ignorePath()", function () {
     it("sets the ignore pattern", function () {
         $request = new Request();
         expect($request->ignorePath())->toBe(null);
         $request->ignorePath('~/webroot$~');
         expect($request->ignorePath())->toBe('~/webroot$~');
     });
     it("lazily applies the ignore pattern on the base path", function () {
         $request = new Request(['basePath' => '/base/path/webroot']);
         expect($request->basePath())->toBe('/base/path/webroot');
         $request->ignorePath('~/webroot$~');
         expect($request->basePath())->toBe('/base/path');
         $request->ignorePath(null);
         expect($request->basePath())->toBe('/base/path/webroot');
     });
 });
 describe("->locale()", function () {
     it("gets the locale", function () {
         $request = new Request(['locale' => 'en']);
         expect($request->locale())->toBe('en');
     });
     it("gets the locale from params", function () {
         $request = new Request(['params' => ['locale' => 'en']]);
         expect($request->locale())->toBe('en');
     });
     it("returns the locale if exists first", function () {