context('when reporter not found', function () { before(function () { $this->console = new Console(['-r', 'unkown'], 'php://output'); $this->console->parseArguments(); }); it('throw pho\\Exception\\ReporterNotFoundException exception', function () { expect(function () { $this->console->getReporterClass(); })->toThrow('pho\\Exception\\ReporterNotFoundException'); }); }); }); context('write', function () { it('prints the text to the terminal', function () { $write = function () { $console = new Console([], 'php://output'); $console->write('test'); }; expect($write)->toPrint('test'); }); }); context('writeLn', function () { it('prints the text, followed by a newline, to the terminal', function () { $writeLn = function () { $console = new Console([], 'php://output'); $console->writeLn('test'); }; expect($writeLn)->toPrint('test' . PHP_EOL); }); }); });