code-standards wrap operators with spaces

This commit is contained in:
Philipp Holzer 2018-07-07 20:51:08 +02:00
parent 1e96faca4c
commit ff24d0d567
No known key found for this signature in database
GPG key ID: 58160D7D6AF942B6
2 changed files with 28 additions and 25 deletions

View 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');
}