Skip to content

Commit

Permalink
Merge pull request #291 from carusogabriel/refactoring-tests
Browse files Browse the repository at this point in the history
Use assertFileExists and assertFileNotExists
  • Loading branch information
Albin Kerouanton authored Dec 3, 2017
2 parents 2863b7f + 1e07421 commit 68590ef
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/Knp/Snappy/PdfTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ public function testRemovesLocalFilesOnDestruct()
$method->setAccessible(true);
$method->invoke($pdf, 'test', $pdf->getDefaultExtension());
$this->assertEquals(1, count($pdf->temporaryFiles));
$this->assertTrue(file_exists(reset($pdf->temporaryFiles)));
$this->assertFileExists(reset($pdf->temporaryFiles));
$pdf->__destruct();
$this->assertFalse(file_exists(reset($pdf->temporaryFiles)));
$this->assertFileNotExists(reset($pdf->temporaryFiles));
}

public function testRemovesLocalFilesOnError()
Expand All @@ -127,7 +127,7 @@ public function testRemovesLocalFilesOnError()
$this->setExpectedException('PHPUnit_Framework_Error');
trigger_error('test error', E_USER_ERROR);

$this->assertFalse(file_exists(reset($pdf->temporaryFiles)));
$this->assertFileNotExists(reset($pdf->temporaryFiles));
}
}

Expand Down

0 comments on commit 68590ef

Please sign in to comment.