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