mirror of
https://github.com/friendica/friendica
synced 2025-04-25 10:30:12 +00:00
Implement Hook::callAll('storage_instance') call for addons and add a description for it.
- Remove implicit Dice usage - Add concrete instance creating - Adding Hook call for addon instance creating - Updating doc for Hook - Updating tests
This commit is contained in:
parent
5d8e6c33ef
commit
bfae6766bf
8 changed files with 155 additions and 62 deletions
18
tests/Util/SampleStorageBackendInstance.php
Normal file
18
tests/Util/SampleStorageBackendInstance.php
Normal file
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
// contains a test-hook call for creating a storage instance
|
||||
|
||||
use Friendica\App;
|
||||
use Friendica\Core\L10n\L10n;
|
||||
use Friendica\Test\Util\SampleStorageBackend;
|
||||
use Mockery\MockInterface;
|
||||
|
||||
function create_instance(App $a, &$data)
|
||||
{
|
||||
/** @var L10n|MockInterface $l10n */
|
||||
$l10n = \Mockery::mock(L10n::class);
|
||||
|
||||
if ($data['name'] == SampleStorageBackend::getName()) {
|
||||
$data['storage'] = new SampleStorageBackend($l10n);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue