You are here

public function ExporterBase::assertDateHandlerWorks in Loft Data Grids 7.2

4 calls to ExporterBase::assertDateHandlerWorks()
ArrayExporterTest::testDateTimeObjectHandling in vendor/aklump/loft_data_grids/tests/phpunit/ArrayExporterTest.php
JSONExporterTest::testDateTimeObjectHandling in vendor/aklump/loft_data_grids/tests/phpunit/JSONExporterTest.php
XMLExporterTest::testDateTimeObjectHandling in vendor/aklump/loft_data_grids/tests/phpunit/XMLExporterTest.php
YAMLExporterTest::testDateTimeObjectHandling in vendor/aklump/loft_data_grids/tests/phpunit/YAMLExporterTest.php

File

vendor/aklump/loft_data_grids/tests/phpunit/ExporterBase.php, line 50
Tests for the YamlExporter class

Class

ExporterBase
Class ExporterBase

Namespace

AKlump\LoftDataGrids

Code

public function assertDateHandlerWorks($control) {
  $data = new ExportData();
  $date = new \DateTime('2010-04-04');
  $control = $control($date
    ->format(\DATE_ISO8601));
  $data
    ->add('date', $date);
  $output = $this->exporter
    ->setData($data)
    ->addSetting('dateFormat', \DATE_ISO8601)
    ->addSetting('prune', true)
    ->export();
  $this
    ->assertSame($control, $output);
}