mirror of
https://git.friendi.ca/friendica/friendica.git
synced 2025-06-12 12:24:28 +02:00
Let AddonFactory implement AddonLoader
This commit is contained in:
parent
1067b2a23a
commit
247e9c5fba
2 changed files with 32 additions and 0 deletions
21
src/Service/Addon/AddonLoader.php
Normal file
21
src/Service/Addon/AddonLoader.php
Normal file
|
@ -0,0 +1,21 @@
|
|||
<?php
|
||||
|
||||
// Copyright (C) 2010-2024, the Friendica project
|
||||
// SPDX-FileCopyrightText: 2010-2024 the Friendica project
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Friendica\Service\Addon;
|
||||
|
||||
/**
|
||||
* Interface for an addon loader.
|
||||
*/
|
||||
interface AddonLoader
|
||||
{
|
||||
/**
|
||||
* @return Addon[] Returns an array of Addon instances.
|
||||
*/
|
||||
public function getAddons(array $addonNames): array;
|
||||
}
|
|
@ -11,11 +11,22 @@ namespace Friendica\Test\Unit\Service\Addon;
|
|||
|
||||
use Friendica\Service\Addon\Addon;
|
||||
use Friendica\Service\Addon\AddonFactory;
|
||||
use Friendica\Service\Addon\AddonLoader;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
||||
class AddonFactoryTest extends TestCase
|
||||
{
|
||||
public function testAddonFactoryImplementsAddonLoaderInterface(): void
|
||||
{
|
||||
$factory = new AddonFactory(
|
||||
dirname(__DIR__, 3) . '/Util',
|
||||
$this->createMock(LoggerInterface::class)
|
||||
);
|
||||
|
||||
$this->assertInstanceOf(AddonLoader::class, $factory);
|
||||
}
|
||||
|
||||
public function testLoadAddonsLoadsTheAddon(): void
|
||||
{
|
||||
$logger = $this->createMock(LoggerInterface::class);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue