Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
die_coolen_jungs
our_own_cloud_project
Commits
27bb968f
Commit
27bb968f
authored
Oct 01, 2014
by
Jörn Friedrich Dreyer
Committed by
Vincent Petry
Oct 08, 2014
Browse files
make some storage tests explain what went wrong
parent
aa3ad898
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/lib/files/storage/storage.php
View file @
27bb968f
...
...
@@ -457,12 +457,12 @@ abstract class Storage extends \PHPUnit_Framework_TestCase {
$this
->
instance
->
file_put_contents
(
'target/test1.txt'
,
'bar'
);
$this
->
instance
->
file_put_contents
(
'target/test2.txt'
,
'bar'
);
$this
->
instance
->
rename
(
'source'
,
'target'
);
$this
->
assertTrue
(
$this
->
instance
->
rename
(
'source'
,
'target'
)
,
'rename must return true on success'
)
;
$this
->
assertFalse
(
$this
->
instance
->
file_exists
(
'source'
));
$this
->
assertFalse
(
$this
->
instance
->
file_exists
(
'source/test1.txt'
));
$this
->
assertFalse
(
$this
->
instance
->
file_exists
(
'target/test2.txt'
));
$this
->
assertEquals
(
'foo'
,
$this
->
instance
->
file_get_contents
(
'target/test1.txt'
));
$this
->
assertFalse
(
$this
->
instance
->
file_exists
(
'source'
)
,
'source has not been removed'
);
$this
->
assertFalse
(
$this
->
instance
->
file_exists
(
'source/test1.txt'
)
,
'source/test1.txt has not been removed'
);
$this
->
assertFalse
(
$this
->
instance
->
file_exists
(
'target/test2.txt'
)
,
'target/test2.txt has not been removed'
);
$this
->
assertEquals
(
'foo'
,
$this
->
instance
->
file_get_contents
(
'target/test1.txt'
)
,
'target/test1.txt has not been overwritten'
);
}
public
function
testRenameOverWriteDirectoryOverFile
()
{
...
...
@@ -471,7 +471,7 @@ abstract class Storage extends \PHPUnit_Framework_TestCase {
$this
->
instance
->
file_put_contents
(
'target'
,
'bar'
);
$this
->
instance
->
rename
(
'source'
,
'target'
);
$this
->
assertTrue
(
$this
->
instance
->
rename
(
'source'
,
'target'
)
,
'rename must return true on success'
)
;
$this
->
assertFalse
(
$this
->
instance
->
file_exists
(
'source'
));
$this
->
assertFalse
(
$this
->
instance
->
file_exists
(
'source/test1.txt'
));
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment