Skip to content

Commit

Permalink
Add plugin test
Browse files Browse the repository at this point in the history
  • Loading branch information
zoglo committed Dec 27, 2023
1 parent 1b05ec5 commit f902eae
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions comments-bundle/tests/ContaoManager/PluginTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php

declare(strict_types=1);

/*
* This file is part of Contao.
*
* (c) Leo Feyer
*
* @license LGPL-3.0-or-later
*/

namespace ContaoManager;

use Contao\CalendarBundle\ContaoCalendarBundle;
use Contao\CommentsBundle\ContaoManager\Plugin;
use Contao\CoreBundle\ContaoCoreBundle;
use Contao\FaqBundle\ContaoFaqBundle;
use Contao\ManagerPlugin\Bundle\Config\BundleConfig;
use Contao\ManagerPlugin\Bundle\Parser\ParserInterface;
use Contao\NewsBundle\ContaoNewsBundle;
use PHPUnit\Framework\TestCase;

class PluginTest extends TestCase
{
public function testReturnsTheBundles(): void
{
$parser = $this->createMock(ParserInterface::class);

/** @var BundleConfig $config */
$config = (new Plugin())->getBundles($parser)[0];

$plugins = [
ContaoCalendarBundle::class,
ContaoCoreBundle::class,
ContaoFaqBundle::class,
ContaoNewsBundle::class,
];

sort($plugins);

$this->assertInstanceOf(BundleConfig::class, $config);
$this->assertSame($plugins, $config->getLoadAfter());
$this->assertSame(['comments'], $config->getReplace());
}
}

0 comments on commit f902eae

Please sign in to comment.