This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Component/Yaml/Tests/ParseExceptionTest.php

35 lines
1.0 KiB
PHP
Raw Normal View History

<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Yaml\Tests;
2017-02-08 07:24:27 +00:00
use PHPUnit\Framework\TestCase;
use Symfony\Component\Yaml\Exception\ParseException;
2017-02-08 07:24:27 +00:00
class ParseExceptionTest extends TestCase
{
public function testGetMessage()
{
2013-09-22 18:26:55 +01:00
$exception = new ParseException('Error message', 42, 'foo: bar', '/var/www/app/config.yml');
2014-11-30 21:18:40 +00:00
$message = 'Error message in "/var/www/app/config.yml" at line 42 (near "foo: bar")';
2013-09-22 18:26:55 +01:00
$this->assertEquals($message, $exception->getMessage());
}
2014-11-01 12:49:09 +00:00
public function testGetMessageWithUnicodeInFilename()
{
$exception = new ParseException('Error message', 42, 'foo: bar', 'äöü.yml');
2014-11-30 21:18:40 +00:00
$message = 'Error message in "äöü.yml" at line 42 (near "foo: bar")';
2014-11-01 12:49:09 +00:00
$this->assertEquals($message, $exception->getMessage());
}
}