mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-07-22 07:43:53 -04:00
#1955 - Make unit test photos unique.
- Added test::random_unique_photo and test::random_unique_photo_unsaved to uniquify test photos. - Uniquified the black dot of test.jpg by coloring it with the six-digit hex code already used to name the random photos (e.g. "name_a48801.jpg"). - Modified four tests in Item_Model_Test that check photo file contents to use new functions to guarantee uniqueness.
This commit is contained in:
@@ -66,7 +66,7 @@ class Item_Model_Test extends Gallery_Unit_Test_Case {
|
||||
}
|
||||
|
||||
public function rename_photo_test() {
|
||||
$item = test::random_photo();
|
||||
$item = test::random_unique_photo();
|
||||
$original_name = $item->name;
|
||||
|
||||
$thumb_file = file_get_contents($item->thumb_path());
|
||||
@@ -89,7 +89,7 @@ class Item_Model_Test extends Gallery_Unit_Test_Case {
|
||||
|
||||
public function rename_album_test() {
|
||||
$album = test::random_album();
|
||||
$photo = test::random_photo($album);
|
||||
$photo = test::random_unique_photo($album);
|
||||
$album->reload();
|
||||
|
||||
$thumb_file = file_get_contents($photo->thumb_path());
|
||||
@@ -152,7 +152,7 @@ class Item_Model_Test extends Gallery_Unit_Test_Case {
|
||||
public function move_album_test() {
|
||||
$album2 = test::random_album();
|
||||
$album1 = test::random_album($album2);
|
||||
$photo = test::random_photo($album1);
|
||||
$photo = test::random_unique_photo($album1);
|
||||
|
||||
$thumb_file = file_get_contents($photo->thumb_path());
|
||||
$resize_file = file_get_contents($photo->resize_path());
|
||||
@@ -180,7 +180,7 @@ class Item_Model_Test extends Gallery_Unit_Test_Case {
|
||||
|
||||
public function move_photo_test() {
|
||||
$album1 = test::random_album();
|
||||
$photo = test::random_photo($album1);
|
||||
$photo = test::random_unique_photo($album1);
|
||||
|
||||
$album2 = test::random_album();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user