DumperTest.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. * (c) Fabien Potencier <fabien.potencier@symfony-project.com>
  5. *
  6. * For the full copyright and license information, please view the LICENSE
  7. * file that was distributed with this source code.
  8. */
  9. namespace Symfony\Tests\Components\DependencyInjection\Dumper;
  10. use Symfony\Components\DependencyInjection\Builder;
  11. use Symfony\Components\DependencyInjection\Dumper\Dumper;
  12. class DumperTest extends \PHPUnit_Framework_TestCase
  13. {
  14. public function testDump()
  15. {
  16. $builder = new Builder();
  17. $dumper = new ProjectDumper($builder);
  18. try {
  19. $dumper->dump();
  20. $this->fail('->dump() returns a LogicException if the dump() method has not been overriden by a children class');
  21. } catch (\Exception $e) {
  22. $this->assertInstanceOf('\LogicException', $e, '->dump() returns a LogicException if the dump() method has not been overriden by a children class');
  23. $this->assertEquals('You must extend this abstract class and implement the dump() method.', $e->getMessage(), '->dump() returns a LogicException if the dump() method has not been overriden by a children class');
  24. }
  25. }
  26. }
  27. class ProjectDumper extends Dumper
  28. {
  29. }