diff options
author | Daniel Kesselberg <mail@danielkesselberg.de> | 2024-08-23 15:10:27 +0200 |
---|---|---|
committer | Daniel Kesselberg <mail@danielkesselberg.de> | 2024-08-25 19:34:58 +0200 |
commit | af6de04e9e141466dc229e444ff3f146f4a34765 (patch) | |
tree | 7b93f521865cdecdadb33637dea33bea242e7969 /tests/lib/LegacyHelperTest.php | |
parent | 1cc6b3577fdbeadece7e4e6478e7f7755555b41a (diff) | |
download | nextcloud-server-af6de04e9e141466dc229e444ff3f146f4a34765.tar.gz nextcloud-server-af6de04e9e141466dc229e444ff3f146f4a34765.zip |
style: update codestyle for coding-standard 1.2.3
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Diffstat (limited to 'tests/lib/LegacyHelperTest.php')
-rw-r--r-- | tests/lib/LegacyHelperTest.php | 152 |
1 files changed, 76 insertions, 76 deletions
diff --git a/tests/lib/LegacyHelperTest.php b/tests/lib/LegacyHelperTest.php index 7d6be9dea7e..85960ef6f08 100644 --- a/tests/lib/LegacyHelperTest.php +++ b/tests/lib/LegacyHelperTest.php @@ -53,35 +53,35 @@ class LegacyHelperTest extends \Test\TestCase { public function providesComputerFileSize() { return [ - [0.0, "0 B"], - [1024.0, "1 KB"], + [0.0, '0 B'], + [1024.0, '1 KB'], [1395864371.0, '1.3 GB'], - [9961472.0, "9.5 MB"], - [500041567437.0, "465.7 GB"], - [false, "12 GB etfrhzui"] + [9961472.0, '9.5 MB'], + [500041567437.0, '465.7 GB'], + [false, '12 GB etfrhzui'] ]; } public function testMb_array_change_key_case() { $arrayStart = [ - "Foo" => "bar", - "Bar" => "foo", + 'Foo' => 'bar', + 'Bar' => 'foo', ]; $arrayResult = [ - "foo" => "bar", - "bar" => "foo", + 'foo' => 'bar', + 'bar' => 'foo', ]; $result = OC_Helper::mb_array_change_key_case($arrayStart); $expected = $arrayResult; $this->assertEquals($result, $expected); $arrayStart = [ - "foo" => "bar", - "bar" => "foo", + 'foo' => 'bar', + 'bar' => 'foo', ]; $arrayResult = [ - "FOO" => "bar", - "BAR" => "foo", + 'FOO' => 'bar', + 'BAR' => 'foo', ]; $result = OC_Helper::mb_array_change_key_case($arrayStart, MB_CASE_UPPER); $expected = $arrayResult; @@ -90,15 +90,15 @@ class LegacyHelperTest extends \Test\TestCase { public function testRecursiveArraySearch() { $haystack = [ - "Foo" => "own", - "Bar" => "Cloud", + 'Foo' => 'own', + 'Bar' => 'Cloud', ]; - $result = OC_Helper::recursiveArraySearch($haystack, "own"); - $expected = "Foo"; + $result = OC_Helper::recursiveArraySearch($haystack, 'own'); + $expected = 'Foo'; $this->assertEquals($result, $expected); - $result = OC_Helper::recursiveArraySearch($haystack, "NotFound"); + $result = OC_Helper::recursiveArraySearch($haystack, 'NotFound'); $this->assertFalse($result); } @@ -109,96 +109,96 @@ class LegacyHelperTest extends \Test\TestCase { $viewMock = $this->createMock(View::class); $viewMock->expects($this->exactly(2)) - ->method('file_exists') - ->withConsecutive( - // Conflict on filename.ext - ['dir/filename.ext'], - ['dir/filename (2).ext'], - ) - ->will($this->onConsecutiveCalls(true, false)); + ->method('file_exists') + ->withConsecutive( + // Conflict on filename.ext + ['dir/filename.ext'], + ['dir/filename (2).ext'], + ) + ->will($this->onConsecutiveCalls(true, false)); $this->assertEquals('dir/filename (2).ext', OC_Helper::buildNotExistingFileNameForView('dir', 'filename.ext', $viewMock)); $viewMock = $this->createMock(View::class); $viewMock->expects($this->exactly(3)) - ->method('file_exists') - ->withConsecutive( - ['dir/filename.ext'], - ['dir/filename (2).ext'], - ['dir/filename (3).ext'], - ) - ->will($this->onConsecutiveCalls(true, true, false)); + ->method('file_exists') + ->withConsecutive( + ['dir/filename.ext'], + ['dir/filename (2).ext'], + ['dir/filename (3).ext'], + ) + ->will($this->onConsecutiveCalls(true, true, false)); $this->assertEquals('dir/filename (3).ext', OC_Helper::buildNotExistingFileNameForView('dir', 'filename.ext', $viewMock)); $viewMock = $this->createMock(View::class); $viewMock->expects($this->exactly(2)) - ->method('file_exists') - ->withConsecutive( - ['dir/filename (1).ext'], - ['dir/filename (2).ext'], - ) - ->will($this->onConsecutiveCalls(true, false)); + ->method('file_exists') + ->withConsecutive( + ['dir/filename (1).ext'], + ['dir/filename (2).ext'], + ) + ->will($this->onConsecutiveCalls(true, false)); $this->assertEquals('dir/filename (2).ext', OC_Helper::buildNotExistingFileNameForView('dir', 'filename (1).ext', $viewMock)); $viewMock = $this->createMock(View::class); $viewMock->expects($this->exactly(2)) - ->method('file_exists') - ->withConsecutive( - ['dir/filename (2).ext'], - ['dir/filename (3).ext'], - ) - ->will($this->onConsecutiveCalls(true, false)); + ->method('file_exists') + ->withConsecutive( + ['dir/filename (2).ext'], + ['dir/filename (3).ext'], + ) + ->will($this->onConsecutiveCalls(true, false)); $this->assertEquals('dir/filename (3).ext', OC_Helper::buildNotExistingFileNameForView('dir', 'filename (2).ext', $viewMock)); $viewMock = $this->createMock(View::class); $viewMock->expects($this->exactly(3)) - ->method('file_exists') - ->withConsecutive( - ['dir/filename (2).ext'], - ['dir/filename (3).ext'], - ['dir/filename (4).ext'], - ) - ->will($this->onConsecutiveCalls(true, true, false)); + ->method('file_exists') + ->withConsecutive( + ['dir/filename (2).ext'], + ['dir/filename (3).ext'], + ['dir/filename (4).ext'], + ) + ->will($this->onConsecutiveCalls(true, true, false)); $this->assertEquals('dir/filename (4).ext', OC_Helper::buildNotExistingFileNameForView('dir', 'filename (2).ext', $viewMock)); $viewMock = $this->createMock(View::class); $viewMock->expects($this->exactly(2)) - ->method('file_exists') - ->withConsecutive( - ['dir/filename(1).ext'], - ['dir/filename(2).ext'], - ) - ->will($this->onConsecutiveCalls(true, false)); + ->method('file_exists') + ->withConsecutive( + ['dir/filename(1).ext'], + ['dir/filename(2).ext'], + ) + ->will($this->onConsecutiveCalls(true, false)); $this->assertEquals('dir/filename(2).ext', OC_Helper::buildNotExistingFileNameForView('dir', 'filename(1).ext', $viewMock)); $viewMock = $this->createMock(View::class); $viewMock->expects($this->exactly(2)) - ->method('file_exists') - ->withConsecutive( - ['dir/filename(1) (1).ext'], - ['dir/filename(1) (2).ext'], - ) - ->will($this->onConsecutiveCalls(true, false)); + ->method('file_exists') + ->withConsecutive( + ['dir/filename(1) (1).ext'], + ['dir/filename(1) (2).ext'], + ) + ->will($this->onConsecutiveCalls(true, false)); $this->assertEquals('dir/filename(1) (2).ext', OC_Helper::buildNotExistingFileNameForView('dir', 'filename(1) (1).ext', $viewMock)); $viewMock = $this->createMock(View::class); $viewMock->expects($this->exactly(3)) - ->method('file_exists') - ->withConsecutive( - ['dir/filename(1) (1).ext'], - ['dir/filename(1) (2).ext'], - ['dir/filename(1) (3).ext'], - ) - ->will($this->onConsecutiveCalls(true, true, false)); + ->method('file_exists') + ->withConsecutive( + ['dir/filename(1) (1).ext'], + ['dir/filename(1) (2).ext'], + ['dir/filename(1) (3).ext'], + ) + ->will($this->onConsecutiveCalls(true, true, false)); $this->assertEquals('dir/filename(1) (3).ext', OC_Helper::buildNotExistingFileNameForView('dir', 'filename(1) (1).ext', $viewMock)); $viewMock = $this->createMock(View::class); $viewMock->expects($this->exactly(2)) - ->method('file_exists') - ->withConsecutive( - ['dir/filename(1) (2) (3).ext'], - ['dir/filename(1) (2) (4).ext'], - ) - ->will($this->onConsecutiveCalls(true, false)); + ->method('file_exists') + ->withConsecutive( + ['dir/filename(1) (2) (3).ext'], + ['dir/filename(1) (2) (4).ext'], + ) + ->will($this->onConsecutiveCalls(true, false)); $this->assertEquals('dir/filename(1) (2) (4).ext', OC_Helper::buildNotExistingFileNameForView('dir', 'filename(1) (2) (3).ext', $viewMock)); } |