public function init()
 {
     $this->language = new \stdClass();
     $this->language->code = 'en_GB';
     Consumer::shouldReceive('language')->andReturn($this->language);
     $this->currentLocale = new CurrentLocaleService();
 }
示例#2
0
 public function testAuthorisedUser()
 {
     $mockUser = m::mock(User::class);
     $this->mockGuard->shouldReceive('guest')->once()->andReturn(false);
     $this->mockGuard->shouldReceive('user')->once()->andReturn($mockUser);
     Consumer::shouldReceive('set')->once();
     $this->middleware->handle($this->mockRequest, function () {
     });
 }