]>
BookStack Code Mirror - bookstack/blobdiff - tests/ImageTest.php
projects
/
bookstack
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Cover image test case
[bookstack]
/
tests
/
ImageTest.php
diff --git
a/tests/ImageTest.php
b/tests/ImageTest.php
index d9acd4b71b8efbdf573bd7f0ccba48e3c5cd2f9a..3bb41138bae7d50dd8d9821fed27bf0ad54ebad0 100644
(file)
--- a/
tests/ImageTest.php
+++ b/
tests/ImageTest.php
@@
-1,6
+1,6
@@
-<?php
+<?php
namespace Tests;
-class ImageTest extends
TestCase
+class ImageTest extends
BrowserKitTest
{
/**
{
/**
@@
-10,7
+10,7
@@
class ImageTest extends TestCase
*/
protected function getTestImage($fileName)
{
*/
protected function getTestImage($fileName)
{
- return new \Illuminate\Http\UploadedFile(base_path('tests/test-image.jpg'), $fileName, 'image/jpeg', 5238);
+ return new \Illuminate\Http\UploadedFile(base_path('tests/test-
data/test-
image.jpg'), $fileName, 'image/jpeg', 5238);
}
/**
}
/**
@@
-57,7
+57,7
@@
class ImageTest extends TestCase
$relPath = $this->uploadImage($imageName, $page->id);
$this->assertResponseOk();
$relPath = $this->uploadImage($imageName, $page->id);
$this->assertResponseOk();
- $this->assertTrue(file_exists(public_path($relPath)), 'Uploaded image
exists'
);
+ $this->assertTrue(file_exists(public_path($relPath)), 'Uploaded image
not found at path: '. public_path($relPath)
);
$this->deleteImage($relPath);
$this->deleteImage($relPath);
@@
-70,7
+70,6
@@
class ImageTest extends TestCase
'updated_by' => $admin->id,
'name' => $imageName
]);
'updated_by' => $admin->id,
'name' => $imageName
]);
-
}
}
@@
-91,7
+90,7
@@
class ImageTest extends TestCase
'type' => 'gallery'
]);
'type' => 'gallery'
]);
- $this->assertFalse(file_exists(public_path($relPath)), 'Uploaded image has
been dele
ted');
+ $this->assertFalse(file_exists(public_path($relPath)), 'Uploaded image has
not been deleted as expec
ted');
}
}
\ No newline at end of file
}
}
\ No newline at end of file