4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\Yaml\Tests;
14 use PHPUnit\Framework\TestCase;
15 use Symfony\Component\Yaml\Exception\ParseException;
17 class ParseExceptionTest extends TestCase
19 public function testGetMessage()
21 $exception = new ParseException('Error message', 42, 'foo: bar', '/var/www/app/config.yml');
22 $message = 'Error message in "/var/www/app/config.yml" at line 42 (near "foo: bar")';
24 $this->assertEquals($message, $exception->getMessage());
27 public function testGetMessageWithUnicodeInFilename()
29 $exception = new ParseException('Error message', 42, 'foo: bar', 'äöü.yml');
30 $message = 'Error message in "äöü.yml" at line 42 (near "foo: bar")';
32 $this->assertEquals($message, $exception->getMessage());