You are here

class FlatTextExporterTest in Loft Data Grids 7.2

Same name and namespace in other branches
  1. 6.2 vendor/aklump/loft_data_grids/tests/FlatFileExporterTest.php \AKlump\LoftDataGrids\FlatTextExporterTest

Hierarchy

  • class \AKlump\LoftDataGrids\FlatTextExporterTest extends \AKlump\LoftDataGrids\PHPUnit_Framework_TestCase

Expanded class hierarchy of FlatTextExporterTest

Related topics

File

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

Namespace

AKlump\LoftDataGrids
View source
class FlatTextExporterTest extends \PHPUnit_Framework_TestCase {
  function testExport() {
    $data = new ExportData();
    $data
      ->setPage('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 FlatTextExporter($data);
    $control = <<<EOD
------------------------------
| DO | RE RE RE | MI MIIIIII |
------------------------------
| C  | D        | E          |
------------------------------
| D  | E        | F#         |
------------------------------

EOD;
    $this
      ->assertSame($control, $obj
      ->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());
    $control = <<<EOD
------------------------------
| DO | RE RE RE | MI MIIIIII |
------------------------------
| C  | D        | E          |
------------------------------
| D  | E        | F#         |
------------------------------

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

}

Members