<?php

namespace JMS\Tests\Composer\Graph;

use JMS\Composer\Graph\DependencyGraph;

class DependencyGraphTest extends \PHPUnit_Framework_TestCase
{
    public function testImplicitCreationOfRootPackage()
    {
        $graph = new DependencyGraph();
        $this->assertCount(1, $graph->getPackages());
        $this->assertTrue($graph->isRootPackage($graph->getPackages()['__root']));
    }
}
<?php

namespace JMS\Tests\Composer\Graph;

use JMS\Composer\Graph\DependencyGraph;

class DependencyGraphTest extends \PHPUnit_Framework_TestCase
{
    public function testImplicitCreationOfRootPackage()
    {
        $graph = new DependencyGraph();
        $packages = $graph->getPackages();
        
        $this->assertCount(1, $packages);
        $this->assertTrue($graph->isRootPackage($packages['__root']));
    }
}
Make sure tests work with PHP 5.3
Make sure tests work with PHP 5.3