Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / consolidation / log / tests / testLogMethods.php
diff --git a/vendor/consolidation/log/tests/testLogMethods.php b/vendor/consolidation/log/tests/testLogMethods.php
new file mode 100644 (file)
index 0000000..5c7e19f
--- /dev/null
@@ -0,0 +1,54 @@
+<?php
+namespace Consolidation\Log;
+
+use Symfony\Component\Console\Output\BufferedOutput;
+use Symfony\Component\Console\Output\OutputInterface;
+
+class LogMethodTests extends \PHPUnit_Framework_TestCase
+{
+  protected $output;
+  protected $logger;
+
+  function setup() {
+    $this->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);
+  }
+}