Storage/Image.t tests failing due to being run as root user. Add SKIP to enable test for non-users only
This commit is contained in:
parent
377386f239
commit
241bb7ebac
1 changed files with 12 additions and 4 deletions
|
|
@ -125,10 +125,18 @@ is($WebGUI::Test::logger_error, q/Can't generate a thumbnail when you haven't sp
|
||||||
is($thumbStore->generateThumbnail('file.txt'), 0, 'generateThumbnail returns 0 if you try to thumbnail a non-image file');
|
is($thumbStore->generateThumbnail('file.txt'), 0, 'generateThumbnail returns 0 if you try to thumbnail a non-image file');
|
||||||
is($WebGUI::Test::logger_warns, q/Can't generate a thumbnail for something that's not an image./, 'generateThumbnail logs a warning message for thumbnailing a non-image file.');
|
is($WebGUI::Test::logger_warns, q/Can't generate a thumbnail for something that's not an image./, 'generateThumbnail logs a warning message for thumbnailing a non-image file.');
|
||||||
chmod 0, $thumbStore->getPath('square.png');
|
chmod 0, $thumbStore->getPath('square.png');
|
||||||
ok(! -r $thumbStore->getPath('square.png'), 'Made square.png not readable');
|
|
||||||
is($thumbStore->generateThumbnail('square.png'), 0, 'generateThumbnail returns 0 if there are errors reading the file');
|
SKIP: {
|
||||||
like($WebGUI::Test::logger_error, qr/^Couldn't read image for thumbnail creation: (.+)$/, 'generateThumbnail when it cannot read the file for thumbnailing');
|
skip "Root will cause this test to fail since it does not obey file permissions", 1
|
||||||
chmod 0644, $thumbStore->getPath('square.png');
|
if $< == 0;
|
||||||
|
ok(! -r $thumbStore->getPath('square.png'), 'Made square.png not readable');
|
||||||
|
is($thumbStore->generateThumbnail('square.png'), 0,
|
||||||
|
'generateThumbnail returns 0 if there are errors reading the file');
|
||||||
|
like($WebGUI::Test::logger_error, qr/^Couldn't read image for thumbnail creation: (.+)$/,
|
||||||
|
'generateThumbnail when it cannot read the file for thumbnailing');
|
||||||
|
chmod oct(644), $thumbStore->getPath('square.png');
|
||||||
|
}
|
||||||
|
|
||||||
ok(-r $thumbStore->getPath('square.png'), 'Made square.png readable again');
|
ok(-r $thumbStore->getPath('square.png'), 'Made square.png readable again');
|
||||||
ok($thumbStore->generateThumbnail('square.png', 50), 'generateThumbnail returns true when there are no problems');
|
ok($thumbStore->generateThumbnail('square.png', 50), 'generateThumbnail returns true when there are no problems');
|
||||||
ok(-e $thumbStore->getPath('thumb-square.png'), 'thumbnail exists in right place with correct name');
|
ok(-e $thumbStore->getPath('thumb-square.png'), 'thumbnail exists in right place with correct name');
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue