diff options
author | Bart Visscher <bartv@thisnet.nl> | 2013-07-05 15:38:09 +0200 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2013-07-05 15:38:09 +0200 |
commit | 22c29eb64b67ee18beacf126eecb78fd4a02608c (patch) | |
tree | e477c298fcfd832ffcf1823ee9d1b5c6951d5aea /tests/lib/helper.php | |
parent | 424ec94680e69a3082a3d3f7c1ceefd7eeae15d2 (diff) | |
download | nextcloud-server-22c29eb64b67ee18beacf126eecb78fd4a02608c.tar.gz nextcloud-server-22c29eb64b67ee18beacf126eecb78fd4a02608c.zip |
Fix renaming using parenthesis
Diffstat (limited to 'tests/lib/helper.php')
-rw-r--r-- | tests/lib/helper.php | 36 |
1 files changed, 27 insertions, 9 deletions
diff --git a/tests/lib/helper.php b/tests/lib/helper.php index 410117a9e67..67b5a3d43ec 100644 --- a/tests/lib/helper.php +++ b/tests/lib/helper.php @@ -154,38 +154,56 @@ class Test_Helper extends PHPUnit_Framework_TestCase { $viewMock->expects($this->at(0)) ->method('file_exists') - ->will($this->returnValue(true)); + ->will($this->returnValue(true)); // filename.ext exists $this->assertEquals('dir/filename (2).ext', OC_Helper::buildNotExistingFileNameForView('dir', 'filename.ext', $viewMock)); $viewMock->expects($this->at(0)) ->method('file_exists') - ->will($this->returnValue(true)); + ->will($this->returnValue(true)); // filename.ext exists $viewMock->expects($this->at(1)) ->method('file_exists') - ->will($this->returnValue(true)); + ->will($this->returnValue(true)); // filename (2).ext exists $this->assertEquals('dir/filename (3).ext', OC_Helper::buildNotExistingFileNameForView('dir', 'filename.ext', $viewMock)); $viewMock->expects($this->at(0)) ->method('file_exists') - ->will($this->returnValue(true)); + ->will($this->returnValue(true)); // filename (1).ext exists $this->assertEquals('dir/filename (2).ext', OC_Helper::buildNotExistingFileNameForView('dir', 'filename (1).ext', $viewMock)); $viewMock->expects($this->at(0)) ->method('file_exists') - ->will($this->returnValue(true)); + ->will($this->returnValue(true)); // filename (2).ext exists + $this->assertEquals('dir/filename (3).ext', OC_Helper::buildNotExistingFileNameForView('dir', 'filename (2).ext', $viewMock)); + + $viewMock->expects($this->at(0)) + ->method('file_exists') + ->will($this->returnValue(true)); // filename (2).ext exists $viewMock->expects($this->at(1)) ->method('file_exists') - ->will($this->returnValue(true)); - $this->assertEquals('dir/filename (3).ext', OC_Helper::buildNotExistingFileNameForView('dir', 'filename (2).ext', $viewMock)); + ->will($this->returnValue(true)); // filename (3).ext exists + $this->assertEquals('dir/filename (4).ext', OC_Helper::buildNotExistingFileNameForView('dir', 'filename (2).ext', $viewMock)); $viewMock->expects($this->at(0)) ->method('file_exists') - ->will($this->returnValue(true)); + ->will($this->returnValue(true)); // filename(1).ext exists $this->assertEquals('dir/filename(2).ext', OC_Helper::buildNotExistingFileNameForView('dir', 'filename(1).ext', $viewMock)); $viewMock->expects($this->at(0)) ->method('file_exists') - ->will($this->returnValue(true)); + ->will($this->returnValue(true)); // filename(1) (1).ext exists $this->assertEquals('dir/filename(1) (2).ext', OC_Helper::buildNotExistingFileNameForView('dir', 'filename(1) (1).ext', $viewMock)); + + $viewMock->expects($this->at(0)) + ->method('file_exists') + ->will($this->returnValue(true)); // filename(1) (1).ext exists + $viewMock->expects($this->at(1)) + ->method('file_exists') + ->will($this->returnValue(true)); // filename(1) (2).ext exists + $this->assertEquals('dir/filename(1) (3).ext', OC_Helper::buildNotExistingFileNameForView('dir', 'filename(1) (1).ext', $viewMock)); + + $viewMock->expects($this->at(0)) + ->method('file_exists') + ->will($this->returnValue(true)); // filename(1) (2) (3).ext exists + $this->assertEquals('dir/filename(1) (2) (4).ext', OC_Helper::buildNotExistingFileNameForView('dir', 'filename(1) (2) (3).ext', $viewMock)); } } |