class PhpArrayDumperTest in Service Container 7
Same name and namespace in other branches
- 7.2 tests/src/DependencyInjection/Dumper/PhpArrayDumperTest.php \Drupal\Tests\service_container\DependencyInjection\Dumper\PhpArrayDumperTest
@coversDefaultClass \Drupal\Component\DependencyInjection\Dumper\PhpArrayDumper @group dic
Hierarchy
- class \Drupal\Tests\service_container\DependencyInjection\Dumper\PhpArrayDumperTest extends \Drupal\Tests\service_container\DependencyInjection\Dumper\PHPUnit_Framework_TestCase
Expanded class hierarchy of PhpArrayDumperTest
File
- tests/
src/ DependencyInjection/ Dumper/ PhpArrayDumperTest.php, line 17 - Contains \Drupal\Tests\service_container\DependencyInjection\Dumper\PhpArrayDumperTest
Namespace
Drupal\Tests\service_container\DependencyInjection\DumperView source
class PhpArrayDumperTest extends \PHPUnit_Framework_TestCase {
/**
* @var ContainerBuilder
*/
protected $container_builder;
/**
* @var PhpArrayDumper
*/
protected $dumper;
/**
* {@inheritdoc}
*/
public function setUp() {
$this->container_builder = new ContainerBuilder();
$this->container_builder
->register('foo', 'My/Class');
$this->container_builder
->setAlias('bar', 'foo');
$this->dumper = new PhpArrayDumper($this->container_builder);
}
/**
* @covers ::dump
*/
public function test_dump() {
$dump = unserialize($this->dumper
->dump());
$this
->assertTrue(is_array($dump));
$this
->assertEquals($dump['aliases']['bar'], 'foo');
$this
->assertEquals($dump['services']['foo'], array(
'class' => 'My/Class',
'arguments_count' => 0,
));
}
/**
* @covers ::getArray
*/
public function test_getArray() {
$dump = $this->dumper
->getArray();
$this
->assertTrue(is_array($dump));
$this
->assertEquals($dump['aliases']['bar'], 'foo');
$this
->assertEquals($dump['services']['foo'], array(
'class' => 'My/Class',
'arguments_count' => 0,
));
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
PhpArrayDumperTest:: |
protected | property | ||
PhpArrayDumperTest:: |
protected | property | ||
PhpArrayDumperTest:: |
public | function | ||
PhpArrayDumperTest:: |
public | function | @covers ::dump | |
PhpArrayDumperTest:: |
public | function | @covers ::getArray |