public function testExecuteWhenSomeFeatureIsDisabled()
 {
     Features::disable('ActionsReport');
     $this->servicesMock->shouldReceive('get')->once()->andReturn([]);
     $this->tester->execute(['command' => $this->command->getName()]);
     $this->assertRegexp('/Gate *\\| *✓ *\\|/', $this->tester->getDisplay());
     $this->assertRegexp('/ActionsReport *\\| *\\|/', $this->tester->getDisplay());
 }
示例#2
0
 public function testEnable()
 {
     // Find it (en vain …)
     $this->assertNotContains('Quux', Features::getEnabled());
     $this->assertFalse(Features::isEnabled('Quux'));
     // Enable it
     Features::enable('Quux');
     $this->assertTrue(Features::isEnabled('Quux'));
     $this->assertContains('Quux', Features::getEnabled());
     // Disable it
     Features::disable('Quux');
     $this->assertFalse(Features::isEnabled('Quux'));
     // Count it
     $this->assertContains('Quux', Features::getAll());
     $this->assertContains('Quux', Features::getAvailable());
     $this->assertNotContains('Quux', Features::getEnabled());
 }
 /**
  * Same than testPost, but without actions report.
  */
 public function testPostWithoutActionsReport()
 {
     Features::disable("ActionsReport");
     $this->sendValidTestPayload();
     $this->assertEmpty($this->response->getContent());
     $this->assertResponseOk();
     // Let's throw an Exception at broker level.
     // Without ActionsReport, the client must always receive a 200 OK.
     $this->app->instance('broker', function ($app) {
         // A non omnipotent instance, so it doesn't mock connect().
         return new BlackholeBroker();
     });
     $this->sendValidTestPayload();
     $this->assertEmpty($this->response->getContent());
     $this->assertResponseOk();
 }