Geen omschrijving

ParseExceptionTest.php 1014B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\Yaml\Tests;
  11. use Symfony\Component\Yaml\Exception\ParseException;
  12. class ParseExceptionTest extends \PHPUnit_Framework_TestCase
  13. {
  14. public function testGetMessage()
  15. {
  16. $exception = new ParseException('Error message', 42, 'foo: bar', '/var/www/app/config.yml');
  17. $message = 'Error message in "/var/www/app/config.yml" at line 42 (near "foo: bar")';
  18. $this->assertEquals($message, $exception->getMessage());
  19. }
  20. public function testGetMessageWithUnicodeInFilename()
  21. {
  22. $exception = new ParseException('Error message', 42, 'foo: bar', 'äöü.yml');
  23. $message = 'Error message in "äöü.yml" at line 42 (near "foo: bar")';
  24. $this->assertEquals($message, $exception->getMessage());
  25. }
  26. }