You are here

class MarkdownTableExporterTest in Loft Data Grids 6.2

Same name and namespace in other branches
  1. 7.2 vendor/aklump/loft_data_grids/tests/phpunit/MarkdownTableExporterTest.php \AKlump\LoftDataGrids\MarkdownTableExporterTest

Hierarchy

Expanded class hierarchy of MarkdownTableExporterTest

Related topics

File

vendor/aklump/loft_data_grids/tests/MarkdownTableExporterTest.php, line 13
Tests for the CSVExporter class

Namespace

AKlump\LoftDataGrids
View source
class MarkdownTableExporterTest extends \PHPUnit_Framework_TestCase {
  function testExport() {
    $data = new ExportData('Notes of the Scale');
    $data
      ->add('do', 'C');
    $data
      ->add('re re re', 'D');
    $data
      ->add('mi miiiiii', 'E')
      ->next();
    $data
      ->add('do', 'D');
    $data
      ->add('re re re', 'E');
    $data
      ->add('mi miiiiii', 'F#')
      ->next();
    $obj = new MarkdownTableExporter($data);
    $control = <<<EOD
## Notes of the Scale
| do | re re re | mi miiiiii |
|----|----------|------------|
| C  | D        | E          |
| D  | E        | F#         |

EOD;
    $this
      ->assertSame($control, $obj
      ->export());
    $control = <<<EOD
| do | re re re | mi miiiiii |
|----|----------|------------|
| C  | D        | E          |
| D  | E        | F#         |

EOD;
    $this
      ->assertSame($control, $obj
      ->hidePageIds()
      ->export());
    $control = <<<EOD
## Notes of the Scale
| do | re re re | mi miiiiii |
|----|----------|------------|
| C  | D        | E          |
| D  | E        | F#         |

EOD;
    $this
      ->assertSame($control, $obj
      ->showPageIds()
      ->export());
  }

}

Members