ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ParseExceptionTest.php
Go to the documentation of this file.
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
13
15
17{
18 public function testGetMessage()
19 {
20 $exception = new ParseException('Error message', 42, 'foo: bar', '/var/www/app/config.yml');
21 $message = 'Error message in "/var/www/app/config.yml" at line 42 (near "foo: bar")';
22
23 $this->assertEquals($message, $exception->getMessage());
24 }
25
27 {
28 $exception = new ParseException('Error message', 42, 'foo: bar', 'äöü.yml');
29 $message = 'Error message in "äöü.yml" at line 42 (near "foo: bar")';
30
31 $this->assertEquals($message, $exception->getMessage());
32 }
33}
An exception for terminatinating execution or to throw for unit testing.
Exception class thrown when an error occurs during parsing.
catch(Exception $e) $message