Example #1
0
 public function testSortOrderWithRequests()
 {
     Request::shouldReceive('get')->twice()->andReturn('description', 'asc');
     $repo = $this->getRepo();
     $repo->model = new App\Ticket();
     $repo->sortOrder();
     $this->assertEquals('select * from `tickets` order by `description` asc', $repo->model->toSql());
 }
 public function testSetCount()
 {
     $redisMock = m::mock('Predis\\Client');
     \Request::shouldReceive('server')->andReturn('127.0.0.1');
     $redisMock->shouldReceive('get')->andReturn(1);
     \Redis::shouldReceive('connection')->andReturn($redisMock);
     $this->assertNull($this->repository->setCount(1));
 }
 /**
  * @test
  */
 public function it_returns_the_appropriate_locale_depending_the_ip_of_the_client()
 {
     $greekIp = '62.103.107.58';
     $germanIp = '82.113.108.15';
     $cyprusIp = '212.31.123.190';
     Request::shouldReceive('ip')->once()->andReturnValues([$greekIp, $germanIp, $cyprusIp]);
     $service = $this->getService();
     $this->assertSame('gr', $service->getCountryCodeFromClientIp());
     $this->assertSame('de', $service->getCountryCodeFromClientIp());
     $this->assertSame('cy', $service->getCountryCodeFromClientIp());
 }
 protected function setupMockConfig($segment = 'day006')
 {
     Request::shouldReceive('segment')->with(1)->andReturn($segment);
     Config::shouldReceive('get')->andReturn(array(array('8', 'day008', 'Day8'), array('6', 'day006', 'Day6'), array('4', 'day004', 'Day4')));
 }