You've already forked gitea-bundle
Initial commit
This commit is contained in:
40
tests/DependencyInjection/MagdevGiteaExtensionTest.php
Normal file
40
tests/DependencyInjection/MagdevGiteaExtensionTest.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Magdev\GiteaBundle\Tests\DependencyInjection;
|
||||
|
||||
use Magdev\GiteaBundle\DependencyInjection\MagdevGiteaExtension;
|
||||
use OwenVoke\Gitea\Client;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
|
||||
/**
|
||||
* @author Marco Grätsch <magdev3.0@gmail.com>
|
||||
*/
|
||||
class MagdevGiteaExtensionTest extends TestCase
|
||||
{
|
||||
public function testExtension(): void
|
||||
{
|
||||
$container = new ContainerBuilder();
|
||||
|
||||
(new MagdevGiteaExtension())->load([
|
||||
'magdev_gitea' => [
|
||||
'connections' => [
|
||||
'primary' => ['baseurl' => 'http://foo1', 'token' => 'bar1'],
|
||||
'secondary' => ['baseurl' => 'http://foo2', 'token' => 'bar2'],
|
||||
],
|
||||
],
|
||||
], $container);
|
||||
|
||||
$this->assertTrue($container->has('magdev.gitea.primary'));
|
||||
$this->assertTrue($container->has('magdev.gitea.secondary'));
|
||||
|
||||
$this->assertTrue($container->hasAlias(Client::class));
|
||||
$this->assertTrue($container->hasAlias(Client::class.' $primaryClient'));
|
||||
$this->assertTrue($container->hasAlias(Client::class.' $secondaryClient'));
|
||||
|
||||
$this->assertInstanceOf(Client::class, $container->get('magdev.gitea.primary'));
|
||||
$this->assertInstanceOf(Client::class, $container->get('magdev.gitea.secondary'));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user