ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ConstraintViolationExceptionTest Class Reference
+ Inheritance diagram for ConstraintViolationExceptionTest:
+ Collaboration diagram for ConstraintViolationExceptionTest:

Public Member Functions

 testTranslationOfMessage ()
 

Detailed Description

Member Function Documentation

◆ testTranslationOfMessage()

ConstraintViolationExceptionTest::testTranslationOfMessage ( )

Definition at line 11 of file ConstraintViolationExceptionTest.php.

12 {
13 $that = $this;
14 $callback = function ($languageId) use ($that) {
15 $that->assertEquals('some_key', $languageId);
16 return 'Some text "%s" and "%s"';
17 };
18
19 try {
20 throw new \ILIAS\Refinery\ConstraintViolationException(
21 'This is an error message for developers',
22 'some_key',
23 'Value To Replace',
24 'Some important stuff'
25 );
26 } catch (\ILIAS\Refinery\ConstraintViolationException $exception) {
27 $this->assertEquals(
28 'Some text "Value To Replace" and "Some important stuff"',
29 $exception->getTranslatedMessage($callback)
30 );
31
32 $this->assertEquals(
33 'This is an error message for developers',
34 $exception->getMessage()
35 );
36 }
37 }
Class ChatMainBarProvider \MainMenu\Provider.

The documentation for this class was generated from the following file: