mirror of
https://github.com/friendica/friendica
synced 2025-04-23 14:30:11 +00:00
Refactor Cache/Lock to DICE
- Refactor Cache classes - Refactor Lock classes - Improved test speed (removed some seperate class annotations)
This commit is contained in:
parent
b95d4f41b9
commit
d56bd28a07
40 changed files with 766 additions and 621 deletions
|
@ -2,6 +2,10 @@
|
|||
|
||||
namespace Friendica\Test\src\Core\Lock;
|
||||
|
||||
use Dice\Dice;
|
||||
use Friendica\App;
|
||||
use Friendica\BaseObject;
|
||||
use Friendica\Core\Config\Configuration;
|
||||
use Friendica\Core\Lock\SemaphoreLockDriver;
|
||||
|
||||
class SemaphoreLockDriverTest extends LockTest
|
||||
|
@ -10,12 +14,21 @@ class SemaphoreLockDriverTest extends LockTest
|
|||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->app->shouldReceive('getHostname')->andReturn('friendica.local');
|
||||
$dice = \Mockery::mock(Dice::class)->makePartial();
|
||||
|
||||
$this->configMock
|
||||
$app = \Mockery::mock(App::class);
|
||||
$app->shouldReceive('getHostname')->andReturn('friendica.local');
|
||||
$dice->shouldReceive('create')->with(App::class)->andReturn($app);
|
||||
|
||||
$configMock = \Mockery::mock(Configuration::class);
|
||||
$configMock
|
||||
->shouldReceive('get')
|
||||
->with('system', 'temppath')
|
||||
->with('system', 'temppath', NULL, false)
|
||||
->andReturn('/tmp/');
|
||||
$dice->shouldReceive('create')->with(Configuration::class)->andReturn($configMock);
|
||||
|
||||
// @todo Because "get_temppath()" is using static methods, we have to initialize the BaseObject
|
||||
BaseObject::setDependencyInjection($dice);
|
||||
}
|
||||
|
||||
protected function getInstance()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue