]> source.dussan.org Git - nextcloud-server.git/commitdiff
make some storage tests explain what went wrong
authorJörn Friedrich Dreyer <jfd@butonic.de>
Wed, 1 Oct 2014 11:12:41 +0000 (13:12 +0200)
committerVincent Petry <pvince81@owncloud.com>
Wed, 8 Oct 2014 16:49:52 +0000 (18:49 +0200)
tests/lib/files/storage/storage.php

index 88fbdd4fcf2d8cc0a1f29354459d6016fd45630f..cf42523a5e2ade58076b0616adede86f568da7d6 100644 (file)
@@ -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'));