From 523697d2af3a60c9df8b5f8759369244b015efc6 Mon Sep 17 00:00:00 2001 From: Josh Pollock Date: Wed, 21 Nov 2018 14:02:46 -0500 Subject: [PATCH] Test to prove that the delete file job will make an uncaught exception in some cases #2814 --- tests/Integration/Jobs/DeleteFileJobTest.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/Integration/Jobs/DeleteFileJobTest.php b/tests/Integration/Jobs/DeleteFileJobTest.php index 2569c02fd..6dcae3bc2 100644 --- a/tests/Integration/Jobs/DeleteFileJobTest.php +++ b/tests/Integration/Jobs/DeleteFileJobTest.php @@ -43,4 +43,17 @@ public function testHandle() //make sure it is deleted $this->assertFalse(file_exists($file['tmp_name'])); } + + /** + * @since 1.8.0 + * + * @covers \calderawp\calderaforms\cf2\Jobs\DeleteFileJob::handle() + */ + public function testHandleWithNonExistantFile() + { + + $job = new DeleteFileJob('noms/foods' ); + $job->handle(); // an exception being thrown here would be bad. + $this->assertTrue(true);//@see https://github.com/sebastianbergmann/phpunit/issues/2484 + } }