]> git.mxchange.org Git - friendica.git/blobdiff - tests/src/Core/Cache/MemoryCacheTest.php
Merge branch 'develop' of https://github.com/friendica/friendica into develop
[friendica.git] / tests / src / Core / Cache / MemoryCacheTest.php
index 3f7af71f6de5392bf71165d96514dd4c8719f157..0f3f6192b232baddca9f797529e32e5384c31364 100644 (file)
@@ -19,50 +19,64 @@ abstract class MemoryCacheTest extends CacheTest
                }
        }
 
+       /**
+        * @small
+        */
        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');
        }
 
+       /**
+        * @small
+        */
        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');
        }
 
+       /**
+        * @small
+        */
        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');
        }
 
+       /**
+        * @small
+        */
        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');
@@ -71,21 +85,24 @@ abstract class MemoryCacheTest extends CacheTest
                $this->assertNull($this->instance->get('value1'), 'Value was wrongly NOT deleted by compareDelete');
        }
 
+       /**
+        * @small
+        */
        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');
        }