You are here

public function ExporterBase::assertSandboxFileEquals in Loft Data Grids 7.2

Compare the sandbox file against it's control file.

For .csv we expect a control file sandbox/control.csv to preexist.

File

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

Class

ExporterBase
Class ExporterBase

Namespace

AKlump\LoftDataGrids

Code

public function assertSandboxFileEquals() {
  $obj = clone $this->exporter;
  $reflect = new \ReflectionClass($obj);
  $basepath = $reflect
    ->getShortName();
  $this->controlFilePath = $this->sandbox . '/' . $obj
    ->setFilename($basepath);
  $this
    ->assertFileExists($this->sandboxFilePath);
  $this
    ->assertFileExists($this->controlFilePath);
  $this
    ->assertFileEquals($this->controlFilePath, $this->sandboxFilePath);
  unlink($this->sandboxFilePath);
  $this
    ->assertFileNotExists($this->sandboxFilePath);
}