Forward port diagnostics and $/ bug fix from 7.4 and Commerce branches.
This commit is contained in:
parent
4b82481594
commit
ed017f6007
2 changed files with 6 additions and 4 deletions
|
|
@ -619,7 +619,7 @@ sub getFileContentsAsScalar {
|
||||||
my $filename = shift;
|
my $filename = shift;
|
||||||
my $content;
|
my $content;
|
||||||
open (my $FILE,"<",$self->getPath($filename));
|
open (my $FILE,"<",$self->getPath($filename));
|
||||||
local undef $/;
|
local $/;
|
||||||
$content = <$FILE>;
|
$content = <$FILE>;
|
||||||
close($FILE);
|
close($FILE);
|
||||||
return $content;
|
return $content;
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ my $session = WebGUI::Test->session;
|
||||||
|
|
||||||
my ($extensionTests, $fileIconTests) = setupDataDrivenTests($session);
|
my ($extensionTests, $fileIconTests) = setupDataDrivenTests($session);
|
||||||
|
|
||||||
my $numTests = 81; # increment this value for each test you create
|
my $numTests = 82; # increment this value for each test you create
|
||||||
plan tests => $numTests + scalar @{ $extensionTests } + scalar @{ $fileIconTests };
|
plan tests => $numTests + scalar @{ $extensionTests } + scalar @{ $fileIconTests };
|
||||||
|
|
||||||
my $uploadDir = $session->config->get('uploadsPath');
|
my $uploadDir = $session->config->get('uploadsPath');
|
||||||
|
|
@ -65,7 +65,7 @@ is( $storage1->getLastError, undef, "No errors during path creation");
|
||||||
#
|
#
|
||||||
####################################################
|
####################################################
|
||||||
|
|
||||||
is( $storage1->getPathFrag, 'fo/ob/foobar');
|
is( $storage1->getPathFrag, 'fo/ob/foobar', 'pathFrag returns correct value');
|
||||||
|
|
||||||
####################################################
|
####################################################
|
||||||
#
|
#
|
||||||
|
|
@ -171,7 +171,7 @@ open my $fcon, "< ".$filePath or
|
||||||
die "Unable to open $filePath for reading: $!\n";
|
die "Unable to open $filePath for reading: $!\n";
|
||||||
my $fileContents;
|
my $fileContents;
|
||||||
{
|
{
|
||||||
local undef $/;
|
local $/;
|
||||||
$fileContents = <$fcon>;
|
$fileContents = <$fcon>;
|
||||||
}
|
}
|
||||||
close $fcon;
|
close $fcon;
|
||||||
|
|
@ -180,6 +180,8 @@ is ($fileContents, $content, 'file contents match');
|
||||||
|
|
||||||
is ($storage1->getFileContentsAsScalar($filename), $content, 'getFileContentsAsScalar matches');
|
is ($storage1->getFileContentsAsScalar($filename), $content, 'getFileContentsAsScalar matches');
|
||||||
|
|
||||||
|
isnt($/, undef, 'getFileContentsAsScalar did not change $/');
|
||||||
|
|
||||||
foreach my $extTest (@{ $extensionTests }) {
|
foreach my $extTest (@{ $extensionTests }) {
|
||||||
is( $storage1->getFileExtension($extTest->{filename}), $extTest->{extension}, $extTest->{comment} );
|
is( $storage1->getFileExtension($extTest->{filename}), $extTest->{extension}, $extTest->{comment} );
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue