-
-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()); | ||
} | ||
} |