- $this->assertEquals('The domain \'testme.now\' is now blocked. (Reason: \'I like it!\')' . PHP_EOL, $txt);
- }
-
- /**
- * Test blockedservers add command with the default reason
- */
- public function testAddBlockedServerWithDefaultReason()
- {
- $this->configMock
- ->shouldReceive('get')
- ->with('system', 'blocklist')
- ->andReturn($this->defaultBlockList)
- ->once();
-
- $newBlockList = $this->defaultBlockList;
- $newBlockList[] = [
- 'domain' => 'testme.now',
- 'reason' => ServerBlock::DEFAULT_REASON,
- ];
-
- $this->configMock
- ->shouldReceive('set')
- ->with('system', 'blocklist', $newBlockList)
- ->andReturn(true)
- ->once();
-
- $console = new ServerBlock($this->consoleArgv);
- $console->setArgument(0, 'add');
- $console->setArgument(1, 'testme.now');
- $txt = $this->dumpExecute($console);
-
- $this->assertEquals('The domain \'testme.now\' is now blocked. (Reason: \'' . ServerBlock::DEFAULT_REASON . '\')' . PHP_EOL, $txt);