mirror of
https://git.friendi.ca/friendica/friendica.git
synced 2025-06-11 09:04:26 +02:00
Move AddonManager into Service namespace
This commit is contained in:
parent
1924cc61a0
commit
5647d8aef4
2 changed files with 8 additions and 6 deletions
|
@ -7,8 +7,10 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Friendica\Addon;
|
namespace Friendica\Service\Addon;
|
||||||
|
|
||||||
|
use Friendica\Addon\Addon;
|
||||||
|
use Friendica\Addon\AddonBootstrap;
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -34,7 +36,7 @@ final class AddonManager
|
||||||
try {
|
try {
|
||||||
$this->bootstrapAddon($addonName);
|
$this->bootstrapAddon($addonName);
|
||||||
} catch (\Throwable $th) {
|
} catch (\Throwable $th) {
|
||||||
// throw $th;
|
throw $th;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -7,21 +7,21 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Friendica\Test\Unit\Addon;
|
namespace Friendica\Test\Unit\Service\Addon;
|
||||||
|
|
||||||
use Friendica\Addon\AddonManager;
|
use Friendica\Service\Addon\AddonManager;
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
|
|
||||||
class AddonManagerTest extends TestCase
|
class AddonManagerTest extends TestCase
|
||||||
{
|
{
|
||||||
public function testLoadAddon(): void
|
public function testBootstrapAddonsLoadsTheAddon(): void
|
||||||
{
|
{
|
||||||
$logger = $this->createMock(LoggerInterface::class);
|
$logger = $this->createMock(LoggerInterface::class);
|
||||||
$logger->expects($this->once())->method('info')->with('Addon "helloaddon" loaded.');
|
$logger->expects($this->once())->method('info')->with('Addon "helloaddon" loaded.');
|
||||||
|
|
||||||
$manager = new AddonManager(
|
$manager = new AddonManager(
|
||||||
dirname(__DIR__, 2) . '/Util',
|
dirname(__DIR__, 3) . '/Util',
|
||||||
$logger
|
$logger
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue