DumperTest.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  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. {
  20. $dumper->dump();
  21. $this->fail('->dump() returns a LogicException if the dump() method has not been overriden by a children class');
  22. }
  23. catch (\Exception $e)
  24. {
  25. $this->assertType('\LogicException', $e, '->dump() returns a LogicException if the dump() method has not been overriden by a children class');
  26. $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');
  27. }
  28. }
  29. }
  30. class ProjectDumper extends Dumper
  31. {
  32. }