YamlReporterTest.php 753 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. namespace Fgm\ComposerCheck\Tests;
  3. use Fgm\ComposerCheck\YamlReporter;
  4. /**
  5. * Test case for the YamlReporter.
  6. */
  7. class YamlReporterTest extends ReporterTestBase {
  8. /**
  9. * {@inheritdoc}
  10. */
  11. public function tearDown() {
  12. $this->reporter = new YamlReporter();
  13. parent::tearDown();
  14. }
  15. /**
  16. * Test reporting on an empty requirements/lock list.
  17. */
  18. public function testEmptyReport() {
  19. $this->prophecy->getRows()->willReturn([]);
  20. $this->expected = '{ }';
  21. }
  22. /**
  23. * Test reporting on a normal non-empty list.
  24. */
  25. public function testNonEmptyReport() {
  26. $this->prophecy->getRows()->willReturn([
  27. 'dev' => [],
  28. 'run' => [],
  29. ]);
  30. $this->expected = <<<YAML
  31. dev: { }
  32. run: { }
  33. YAML;
  34. }
  35. }