-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPluginTest.php
More file actions
66 lines (59 loc) · 2.24 KB
/
Copy pathPluginTest.php
File metadata and controls
66 lines (59 loc) · 2.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
/**
* This file is part of MetaModels/attribute_translatedcontentarticle.
*
* (c) 2012-2024 The MetaModels team.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* This project is provided in good faith and hope to be usable by anyone.
*
* @package MetaModels
* @subpackage AttributeTranslatedContentArticle
* @author Stefan Heimes <stefan_heimes@hotmail.com>
* @author Ingolf Steinhardt <info@e-spin.de>
* @copyright 2012-2024 The MetaModels team.
* @license https://github.com/MetaModels/attribute_translatedcontentarticle/blob/master/LICENSE LGPL-3.0-or-later
* @filesource
*/
declare(strict_types=1);
namespace ContaoManager;
use Contao\ManagerPlugin\Bundle\Config\ConfigInterface;
use Contao\ManagerPlugin\Bundle\Parser\ParserInterface;
use MetaModels\AttributeTranslatedContentArticleBundle\ContaoManager\Plugin;
use MetaModels\AttributeTranslatedContentArticleBundle\MetaModelsAttributeTranslatedContentArticleBundle;
use MetaModels\CoreBundle\MetaModelsCoreBundle;
use PHPUnit\Framework\TestCase;
/**
* @covers \MetaModels\AttributeTranslatedContentArticleBundle\ContaoManager\Plugin
*/
class PluginTest extends TestCase
{
public function testGetBundles(): void
{
$parser = $this->createMock(ParserInterface::class);
$config = $this->createMock(ConfigInterface::class);
$config
->expects(self::once())
->method('getName')
->willReturn(MetaModelsAttributeTranslatedContentArticleBundle::class);
$config
->expects(self::once())
->method('getLoadAfter')
->willReturn([
MetaModelsCoreBundle::class
]);
$config
->expects(self::once())
->method('getReplace')
->willReturn(['metamodelsattribute_translatedarticle']);
$plugin = new Plugin();
$bundles = $plugin->getBundles($parser);
foreach ($bundles as $bundle) {
self::assertSame($config->getName(), $bundle->getName());
self::assertSame($config->getLoadAfter(), $bundle->getLoadAfter());
self::assertSame($config->getReplace(), $bundle->getReplace());
}
}
}