mirror of
https://git.friendi.ca/friendica/friendica.git
synced 2025-06-10 21:34:26 +02:00
Create AddonFactory
This commit is contained in:
parent
883674725f
commit
1067b2a23a
2 changed files with 105 additions and 0 deletions
34
tests/Unit/Service/Addon/AddonFactoryTest.php
Normal file
34
tests/Unit/Service/Addon/AddonFactoryTest.php
Normal file
|
@ -0,0 +1,34 @@
|
|||
<?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\Test\Unit\Service\Addon;
|
||||
|
||||
use Friendica\Service\Addon\Addon;
|
||||
use Friendica\Service\Addon\AddonFactory;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
||||
class AddonFactoryTest extends TestCase
|
||||
{
|
||||
public function testLoadAddonsLoadsTheAddon(): void
|
||||
{
|
||||
$logger = $this->createMock(LoggerInterface::class);
|
||||
$logger->expects($this->once())->method('info')->with('Addon "helloaddon" loaded.');
|
||||
|
||||
$factory = new AddonFactory(
|
||||
dirname(__DIR__, 3) . '/Util',
|
||||
$logger
|
||||
);
|
||||
|
||||
$addons = $factory->getAddons(['helloaddon' => []]);
|
||||
|
||||
$this->assertArrayHasKey('helloaddon', $addons);
|
||||
$this->assertInstanceOf(Addon::class, $addons['helloaddon']);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue