forked from ezsystems/PlatformUIBundle
/
AggregatorTest.php
44 lines (39 loc) · 1.3 KB
/
AggregatorTest.php
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
<?php
/**
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
namespace EzSystems\PlatformUIBundle\Tests\ApplicationConfig;
use EzSystems\PlatformUIBundle\ApplicationConfig\Aggregator;
use PHPUnit_Framework_TestCase;
/**
* @covers \EzSystems\PlatformUIBundle\ApplicationConfig\Aggregator
*/
class AggregatorTest extends PHPUnit_Framework_TestCase
{
public function testAddProviders()
{
$aggregator = new Aggregator();
$aggregator->addProviders(['a' => $this->createProvider(), 'b' => $this->createProvider()]);
}
public function testGetConfig()
{
$aggregator = new Aggregator();
$aggregator->addProviders(['a' => $this->createProvider(), 'b' => $this->createProvider()]);
self::assertEquals(
['a' => [], 'b' => []],
$aggregator->getConfig()
);
}
/**
* @return \EzSystems\PlatformUIBundle\ApplicationConfig\Provider|\PHPUnit_Framework_MockObject_MockObject
*/
private function createProvider()
{
$mock = $this->getMock('\EzSystems\PlatformUIBundle\ApplicationConfig\Provider');
$mock
->expects($this->any())
->method('getConfig')
->will($this->returnValue([]));
return $mock;
}
}