Skip to content
Snippets Groups Projects
Commit 2eb4728f authored by Jonathan Foucher's avatar Jonathan Foucher
Browse files

Remove file before running test

parent be64d609
No related branches found
No related tags found
No related merge requests found
......@@ -130,6 +130,14 @@ public function testAdminCanUploadFileToMeasure()
$m = Measure::first()->toArray();
$docName = 'documents/mesures/name-'.$m['id'].'/name-'.$m['id'].'-niveau1.png';
$fullPath = storage_path('app/public/' . $docName);
if(file_exists($fullPath)) {
unlink($fullPath);
}
$response = $this->actingAs($user)->putJson(route('api.measures.put', ['id' => $m['id'],
'name' => 'name',
'short_name' => 'SHORT_NAME',
......@@ -170,9 +178,10 @@ public function testAdminCanUploadFileToMeasure()
$docName = 'documents/mesures/name-'.$m->id.'/name-'.$m->id.'-niveau1.png';
$this->assertTrue(file_exists(public_path($docName)));
$fullPath = storage_path('app/public/' . $docName);
$this->assertTrue(file_exists($fullPath));
$file = file_get_contents(public_path($docName));
$file = file_get_contents($fullPath);
$this->assertNotNull($file);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment