'social.nobodyhasthe.biz', 'reason' => 'Illegal content', ], [ 'domain' => 'pod.ordoevangelistarum.com', 'reason' => 'Illegal content', ] ]; protected function setUp() { parent::setUp(); $this->mockApp($this->root); } /** * Test to list the default blocked servers */ public function testBlockedServerList() { $this->configMock ->shouldReceive('get') ->with('system', 'blocklist') ->andReturn($this->defaultBlockList) ->once(); $console = new BlockedServers($this->consoleArgv); $txt = $this->dumpExecute($console); $output = <<assertEquals($output, $txt); } public function testAddBlockedServer() { $this->configMock ->shouldReceive('get') ->with('system', 'blocklist') ->andReturn($this->defaultBlockList) ->once(); $newBlockList = $this->defaultBlockList; $newBlockList[] = [ 'domain' => 'testme.now', 'reason' => 'I like it!', ]; $this->configMock ->shouldReceive('set') ->with('system', 'blocklist', $newBlockList) ->andReturn(true) ->once(); $console = new BlockedServers($this->consoleArgv); $console->setArgument(0, 'add'); $console->setArgument(1, 'testme.now'); $console->setArgument(2, 'I like it!'); $txt = $this->dumpExecute($console); $this->assertEquals('The domain \'testme.now\' is now blocked. (Reason: \'I like it!\')' . PHP_EOL, $txt); } }