public function testChecksForMaintenanceMode()
 {
     $scheduledCommand = $this->mockCommand();
     $scheduledCommand->shouldReceive('runInMaintenanceMode')->never();
     App::shouldReceive('isDownForMaintenance')->andReturn(false);
     $this->assertTrue($this->commandService->runnableInCurrentMaintenanceSetting($scheduledCommand));
 }
 public function testMapRepositoryFromConfig()
 {
     \App::shouldReceive('make')->andReturn(new PersonRepository(new Person()));
     $repository = Mapper::mapRepository('person');
     $this->assertEquals('Tests\\Foothing\\RepositoryController\\Resources\\PersonRepository', get_class($repository));
 }
 public function testOnCartAddedWhenInServiceEnvironment()
 {
     //mocks
     $add_profile_mgr_mock = \Mockery::mock('Giftertipster\\Service\\Add\\AddProfileMgrInterface');
     $add_profile_mgr_mock->shouldReceive('getUserAddProfile')->never();
     $this->app->instance('Giftertipster\\Service\\Add\\AddProfileMgrInterface', $add_profile_mgr_mock);
     $add_profile_mgr = \App::make('Giftertipster\\Service\\Add\\AddProfileMgrInterface');
     $sales_agent_mgr = \App::make('Giftertipster\\Service\\SalesAgent\\SalesAgentMgrInterface');
     \App::shouldReceive('environment')->atLeast('once')->andReturn('service');
     \App::shouldReceive('make')->with('Giftertipster\\Service\\Add\\AddProfileMgrInterface')->andReturn($add_profile_mgr);
     \App::shouldReceive('make')->with('Giftertipster\\Service\\SalesAgent\\SalesAgentMgrInterface')->andReturn($sales_agent_mgr);
     \Queue::shouldReceive('push')->never();
     \Session::shouldReceive('get')->never();
     \Session::shouldReceive('put')->never();
     //action
     $this->getEventSub()->onCartAdded(1);
 }