class GraphvizDumperTest in Service Container 7.2
Same name and namespace in other branches
- 7 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Tests/Dumper/GraphvizDumperTest.php \Symfony\Component\DependencyInjection\Tests\Dumper\GraphvizDumperTest
Hierarchy
- class \Symfony\Component\DependencyInjection\Tests\Dumper\GraphvizDumperTest extends \Symfony\Component\DependencyInjection\Tests\Dumper\PHPUnit_Framework_TestCase
Expanded class hierarchy of GraphvizDumperTest
File
- modules/
providers/ service_container_symfony/ lib/ Symfony/ Component/ DependencyInjection/ Tests/ Dumper/ GraphvizDumperTest.php, line 17
Namespace
Symfony\Component\DependencyInjection\Tests\DumperView source
class GraphvizDumperTest extends \PHPUnit_Framework_TestCase {
protected static $fixturesPath;
public static function setUpBeforeClass() {
self::$fixturesPath = __DIR__ . '/../Fixtures/';
}
/**
* @group legacy
*/
public function testLegacyDump() {
$this
->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
$container = (include self::$fixturesPath . '/containers/legacy-container9.php');
$dumper = new GraphvizDumper($container);
$this
->assertEquals(str_replace('%path%', __DIR__, file_get_contents(self::$fixturesPath . '/graphviz/legacy-services9.dot')), $dumper
->dump(), '->dump() dumps services');
}
public function testDump() {
$dumper = new GraphvizDumper($container = new ContainerBuilder());
$this
->assertStringEqualsFile(self::$fixturesPath . '/graphviz/services1.dot', $dumper
->dump(), '->dump() dumps an empty container as an empty dot file');
$container = (include self::$fixturesPath . '/containers/container9.php');
$dumper = new GraphvizDumper($container);
$this
->assertEquals(str_replace('%path%', __DIR__, file_get_contents(self::$fixturesPath . '/graphviz/services9.dot')), $dumper
->dump(), '->dump() dumps services');
$container = (include self::$fixturesPath . '/containers/container10.php');
$dumper = new GraphvizDumper($container);
$this
->assertEquals(str_replace('%path%', __DIR__, file_get_contents(self::$fixturesPath . '/graphviz/services10.dot')), $dumper
->dump(), '->dump() dumps services');
$container = (include self::$fixturesPath . '/containers/container10.php');
$dumper = new GraphvizDumper($container);
$this
->assertEquals($dumper
->dump(array(
'graph' => array(
'ratio' => 'normal',
),
'node' => array(
'fontsize' => 13,
'fontname' => 'Verdana',
'shape' => 'square',
),
'edge' => array(
'fontsize' => 12,
'fontname' => 'Verdana',
'color' => 'white',
'arrowhead' => 'closed',
'arrowsize' => 1,
),
'node.instance' => array(
'fillcolor' => 'green',
'style' => 'empty',
),
'node.definition' => array(
'fillcolor' => 'grey',
),
'node.missing' => array(
'fillcolor' => 'red',
'style' => 'empty',
),
)), str_replace('%path%', __DIR__, file_get_contents(self::$fixturesPath . '/graphviz/services10-1.dot')), '->dump() dumps services');
}
public function testDumpWithFrozenContainer() {
$container = (include self::$fixturesPath . '/containers/container13.php');
$dumper = new GraphvizDumper($container);
$this
->assertEquals(str_replace('%path%', __DIR__, file_get_contents(self::$fixturesPath . '/graphviz/services13.dot')), $dumper
->dump(), '->dump() dumps services');
}
public function testDumpWithFrozenCustomClassContainer() {
$container = (include self::$fixturesPath . '/containers/container14.php');
$dumper = new GraphvizDumper($container);
$this
->assertEquals(str_replace('%path%', __DIR__, file_get_contents(self::$fixturesPath . '/graphviz/services14.dot')), $dumper
->dump(), '->dump() dumps services');
}
public function testDumpWithUnresolvedParameter() {
$container = (include self::$fixturesPath . '/containers/container17.php');
$dumper = new GraphvizDumper($container);
$this
->assertEquals(str_replace('%path%', __DIR__, file_get_contents(self::$fixturesPath . '/graphviz/services17.dot')), $dumper
->dump(), '->dump() dumps services');
}
public function testDumpWithScopes() {
$container = (include self::$fixturesPath . '/containers/container18.php');
$dumper = new GraphvizDumper($container);
$this
->assertEquals(str_replace('%path%', __DIR__, file_get_contents(self::$fixturesPath . '/graphviz/services18.dot')), $dumper
->dump(), '->dump() dumps services');
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
GraphvizDumperTest:: |
protected static | property | ||
GraphvizDumperTest:: |
public static | function | ||
GraphvizDumperTest:: |
public | function | ||
GraphvizDumperTest:: |
public | function | ||
GraphvizDumperTest:: |
public | function | ||
GraphvizDumperTest:: |
public | function | ||
GraphvizDumperTest:: |
public | function | ||
GraphvizDumperTest:: |
public | function | @group legacy |