]> git.mxchange.org Git - friendica.git/commitdiff
code-standards wrap operators with spaces
authorPhilipp Holzer <admin@philipp.info>
Sat, 7 Jul 2018 18:51:08 +0000 (20:51 +0200)
committerPhilipp Holzer <admin@philipp.info>
Sat, 7 Jul 2018 18:51:08 +0000 (20:51 +0200)
tests/src/Core/Cache/CacheTest.php
tests/src/Core/Cache/MemoryCacheTest.php

index 419e0cd2bd589fd0999b64340d33f0c9617eda59..4f3e4d351c844970137cb34ee2efcf3a9cde221b 100644 (file)
@@ -36,18 +36,19 @@ abstract class CacheTest extends DatabaseTest
        function testSimple() {
                $this->assertNull($this->instance->get('value1'));
 
-               $value='foobar';
+               $value = 'foobar';
                $this->instance->set('value1', $value);
-               $received=$this->instance->get('value1');
+               $received = $this->instance->get('value1');
                $this->assertEquals($value, $received, 'Value received from cache not equal to the original');
-               $value='ipsum lorum';
+
+               $value = 'ipsum lorum';
                $this->instance->set('value1', $value);
-               $received=$this->instance->get('value1');
+               $received = $this->instance->get('value1');
                $this->assertEquals($value, $received, 'Value not overwritten by second set');
 
-               $value2='foobar';
+               $value2 = 'foobar';
                $this->instance->set('value2', $value2);
-               $received2=$this->instance->get('value2');
+               $received2 = $this->instance->get('value2');
                $this->assertEquals($value, $received, 'Value changed while setting other variable');
                $this->assertEquals($value2, $received2, 'Second value not equal to original');
 
@@ -58,7 +59,7 @@ abstract class CacheTest extends DatabaseTest
        }
 
        function testClear() {
-               $value='ipsum lorum';
+               $value = 'ipsum lorum';
                $this->instance->set('1_value1', $value . '1');
                $this->instance->set('1_value2', $value . '2');
                $this->instance->set('2_value1', $value . '3');
@@ -94,9 +95,9 @@ abstract class CacheTest extends DatabaseTest
        function testTTL() {
                $this->assertNull($this->instance->get('value1'));
 
-               $value='foobar';
+               $value = 'foobar';
                $this->instance->set('value1', $value, 1);
-               $received=$this->instance->get('value1');
+               $received = $this->instance->get('value1');
                $this->assertEquals($value, $received, 'Value received from cache not equal to the original');
 
                sleep(2);
index 3f7af71f6de5392bf71165d96514dd4c8719f157..670df2fe187ee52d4d5f811226cd9276adb5fc30 100644 (file)
@@ -22,26 +22,28 @@ abstract class MemoryCacheTest extends CacheTest
        function testCompareSet() {
                $this->assertNull($this->instance->get('value1'));
 
-               $value='foobar';
+               $value = 'foobar';
                $this->instance->add('value1', $value);
-               $received=$this->instance->get('value1');
+               $received = $this->instance->get('value1');
                $this->assertEquals($value, $received, 'Value received from cache not equal to the original');
-               $newValue='ipsum lorum';
+
+               $newValue = 'ipsum lorum';
                $this->instance->compareSet('value1', $value, $newValue);
-               $received=$this->instance->get('value1');
+               $received = $this->instance->get('value1');
                $this->assertEquals($newValue, $received, 'Value not overwritten by compareSet');
        }
 
        function testNegativeCompareSet() {
                $this->assertNull($this->instance->get('value1'));
 
-               $value='foobar';
+               $value = 'foobar';
                $this->instance->add('value1', $value);
-               $received=$this->instance->get('value1');
+               $received = $this->instance->get('value1');
                $this->assertEquals($value, $received, 'Value received from cache not equal to the original');
-               $newValue='ipsum lorum';
+
+               $newValue = 'ipsum lorum';
                $this->instance->compareSet('value1', 'wrong', $newValue);
-               $received=$this->instance->get('value1');
+               $received = $this->instance->get('value1');
                $this->assertNotEquals($newValue, $received, 'Value was wrongly overwritten by compareSet');
                $this->assertEquals($value, $received, 'Value was wrongly overwritten by any other value');
        }
@@ -49,9 +51,9 @@ abstract class MemoryCacheTest extends CacheTest
        function testCompareDelete() {
                $this->assertNull($this->instance->get('value1'));
 
-               $value='foobar';
+               $value = 'foobar';
                $this->instance->add('value1', $value);
-               $received=$this->instance->get('value1');
+               $received = $this->instance->get('value1');
                $this->assertEquals($value, $received, 'Value received from cache not equal to the original');
                $this->instance->compareDelete('value1', $value);
                $this->assertNull($this->instance->get('value1'), 'Value was not deleted by compareDelete');
@@ -60,9 +62,9 @@ abstract class MemoryCacheTest extends CacheTest
        function testNegativeCompareDelete() {
                $this->assertNull($this->instance->get('value1'));
 
-               $value='foobar';
+               $value = 'foobar';
                $this->instance->add('value1', $value);
-               $received=$this->instance->get('value1');
+               $received = $this->instance->get('value1');
                $this->assertEquals($value, $received, 'Value received from cache not equal to the original');
                $this->instance->compareDelete('value1', 'wrong');
                $this->assertNotNull($this->instance->get('value1'), 'Value was wrongly compareDeleted');
@@ -74,18 +76,18 @@ abstract class MemoryCacheTest extends CacheTest
        function testAdd() {
                $this->assertNull($this->instance->get('value1'));
 
-               $value='foobar';
+               $value = 'foobar';
                $this->instance->add('value1', $value);
 
-               $newValue='ipsum lorum';
+               $newValue = 'ipsum lorum';
                $this->instance->add('value1', $newValue);
-               $received=$this->instance->get('value1');
+               $received = $this->instance->get('value1');
                $this->assertNotEquals($newValue, $received, 'Value was wrongly overwritten by add');
                $this->assertEquals($value, $received, 'Value was wrongly overwritten by any other value');
 
                $this->instance->delete('value1');
                $this->instance->add('value1', $newValue);
-               $received=$this->instance->get('value1');
+               $received = $this->instance->get('value1');
                $this->assertEquals($newValue, $received, 'Value was not overwritten by add');
                $this->assertNotEquals($value, $received, 'Value was not overwritten by any other value');
        }