<?php
-namespace Friendica\Test\Core\Config;
+namespace Friendica\Test\src\Core\Config;
use Friendica\Core\Config\Adapter\IConfigAdapter;
use Friendica\Core\Config\Cache\ConfigCache;
$this->assertNull($configuration->get('test', 'it'));
/// beware that the cache returns '!<unset>!' and not null for a non existing value
- $this->assertEquals('!<unset>!', $configuration->getCache()->get('test', 'it'));
+ $this->assertNull($configuration->getCache()->get('test', 'it'));
// with default value
$this->assertEquals('default', $configuration->get('test', 'it', 'default'));
$configAdapter->shouldReceive('isLoaded')->with('test', 'it')->andReturn(true)->twice();
$configAdapter->shouldReceive('get')->with('test', 'it')->andReturn($data)->once();
$configAdapter->shouldReceive('isLoaded')->with('test', 'not')->andReturn(false)->once();
- $configAdapter->shouldReceive('get')->with('test', 'not')->andReturn('!<unset>!')->once();
+ $configAdapter->shouldReceive('get')->with('test', 'not')->andReturn(null)->once();
$configuration = new Configuration($configCache, $configAdapter);
// without refresh and wrong value and default
$this->assertEquals('default', $configuration->get('test', 'not', 'default'));
- $this->assertEquals('!<unset>!', $configuration->getCache()->get('test', 'not'));
+ $this->assertNull($configuration->getCache()->get('test', 'not'));
}
/**
$configAdapter->shouldReceive('load')->andReturn([])->once();
$configAdapter->shouldReceive('isLoaded')->with('test', 'it')->andReturn(false)->once();
- $configAdapter->shouldReceive('get')->with('test', 'it')->andReturn('!<unset>!')->once();
+ $configAdapter->shouldReceive('get')->with('test', 'it')->andReturn(null)->once();
$configAdapter->shouldReceive('isLoaded')->with('test', 'it')->andReturn(false)->once();
$configAdapter->shouldReceive('get')->with('test', 'it')->andReturn($data)->once();
$this->assertTrue($configuration->delete('test', 'it'));
$this->assertNull($configuration->get('test', 'it'));
- $this->assertEquals('!<unset>!', $configuration->getCache()->get('test', 'it'));
+ $this->assertNull($configuration->getCache()->get('test', 'it'));
$this->assertEmpty($configuration->getCache()->getAll());
}