Skip to content

Commit 99b31cb

Browse files
committed
Force a clean test environment
1 parent b1bf2d9 commit 99b31cb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/AsyncTaskTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ public function testAsyncTimeoutIgnoreErrors()
154154
// test that the async timeout handler is not triggered due to other fatal errors
155155
$message = "timeout occured";
156156
$textFilePath = $this->getStoragePath("testAsyncTimeoutIgnoreErrors.txt");
157+
@unlink($textFilePath);
157158
$timeoutTask = new TestTimeoutErrorTask($message, $textFilePath);
158159
$task = new AsyncTask($timeoutTask);
159160
$task->withTimeLimit(1)->start();
@@ -169,6 +170,7 @@ public function testAsyncTimeoutIgnoreNoProblem()
169170
// test that the async timeout handler is not triggered when nothing happened
170171
$message = "timeout occured";
171172
$textFilePath = $this->getStoragePath("testAsyncTimeoutIgnoreNoProblem.txt");
173+
@unlink($textFilePath);
172174
$timeoutTask = new TestTimeoutNoOpTask($message, $textFilePath);
173175
$task = new AsyncTask($timeoutTask);
174176
$task->withTimeLimit(1)->start();
@@ -179,6 +181,7 @@ public function testAsyncTimeoutIgnoreNoProblem()
179181
$this->assertNoNohupFile();
180182

181183
// repeat with no time limit
184+
@unlink($textFilePath);
182185
$task = new AsyncTask($timeoutTask);
183186
$task->withoutTimeLimit()->start();
184187
// we wait for it to timeout
@@ -193,6 +196,7 @@ public function testAsyncTimeoutIgnoreENotice()
193196
// test that the async timeout handler is not triggered when there is an E_NOTICE error
194197
$message = "timeout occured";
195198
$textFilePath = $this->getStoragePath("testAsyncTimeoutIgnoreENotice.txt");
199+
@unlink($textFilePath);
196200
$timeoutTask = new TestTimeoutENoticeTask($message, $textFilePath);
197201
$task = new AsyncTask($timeoutTask);
198202
$task->withTimeLimit(1)->start();

0 commit comments

Comments
 (0)