X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fconsolidation%2Flog%2Ftests%2FtestLogMethods.php;fp=vendor%2Fconsolidation%2Flog%2Ftests%2FtestLogMethods.php;h=5c7e19f04bb45e48ee8e86413d913e58766ebd38;hp=0000000000000000000000000000000000000000;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/vendor/consolidation/log/tests/testLogMethods.php b/vendor/consolidation/log/tests/testLogMethods.php new file mode 100644 index 000000000..5c7e19f04 --- /dev/null +++ b/vendor/consolidation/log/tests/testLogMethods.php @@ -0,0 +1,54 @@ +output = new BufferedOutput(); + $this->output->setVerbosity(OutputInterface::VERBOSITY_DEBUG); + $this->logger = new Logger($this->output); + $this->logger->setLogOutputStyler(new UnstyledLogOutputStyler()); + } + + function testError() { + $this->logger->error('Do not enter - wrong way.'); + $outputText = rtrim($this->output->fetch()); + $this->assertEquals(' [error] Do not enter - wrong way.', $outputText); + } + + function testWarning() { + $this->logger->warning('Steep grade.'); + $outputText = rtrim($this->output->fetch()); + $this->assertEquals(' [warning] Steep grade.', $outputText); + } + + function testNotice() { + $this->logger->notice('No loitering.'); + $outputText = rtrim($this->output->fetch()); + $this->assertEquals(' [notice] No loitering.', $outputText); + } + + function testInfo() { + $this->logger->info('Scenic route.'); + $outputText = rtrim($this->output->fetch()); + $this->assertEquals(' [info] Scenic route.', $outputText); + } + + function testDebug() { + $this->logger->debug('Counter incremented.'); + $outputText = rtrim($this->output->fetch()); + $this->assertEquals(' [debug] Counter incremented.', $outputText); + } + + function testSuccess() { + $this->logger->success('It worked!'); + $outputText = rtrim($this->output->fetch()); + $this->assertEquals(' [success] It worked!', $outputText); + } +}