Ejemplo n.º 1
0
 public function init()
 {
     $this->language = new \stdClass();
     $this->language->code = 'en_GB';
     Consumer::shouldReceive('language')->andReturn($this->language);
     $this->currentLocale = new CurrentLocaleService();
 }
Ejemplo n.º 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 () {
     });
 }
Ejemplo n.º 3
0
 /**
  * Determines the current language/locale based on consumer settings.
  *
  * @return Language
  */
 protected function determine()
 {
     return Consumer::language();
 }