/** * Sys news record is displayed at the login page. * * @param string $header Header text * @param string $text Basic text * * @return void */ public function createSysNewsCommand($header, $text = '') { $result = FALSE; try { $result = $this->siteApiService->createSysNews($header, $text); } catch (\Exception $e) { $this->outputLine($e->getMessage()); $this->quit(1); } if ($result) { $this->outputLine('News entry successfully created.'); } else { $this->outputLine('News entry NOT created.'); $this->quit(1); } }
/** * @test * @covers ::createSysNews * @expectedException \InvalidArgumentException * @expectedExceptionMessage No header given */ public function createSysNewsNoHeaderGivenThrowsException() { $this->subject->createSysNews('', 'Foo'); }