tests/I18n/MessagesTest.php
/**
     * Test basic function like get translation with and without custom dictionary.
     */
Test basic function like get translation with and without custom dictionary.
Test basic function like get translation with and without custom dictionary .
public function testBasicFunctions(): void
    {
        self::assertEquals('foo', _('foo'));
        self::assertEquals('foo 123 text', _('foo %d %s', 123, 'text'));
        Messages::setTranslations([
            'foo' => 'boo',
            'foo %d %s' => '%d %s boo',
        ]);
        self::assertEquals('boo', _('foo'));
        self::assertEquals('123 text boo', _('foo %d %s', 123, 'text'));
    }
public function testBasicFunctions ( ) : void { self :: assertEquals ( 'foo' , _ ( 'foo' ) ) ; self :: assertEquals ( 'foo 123 text' , _ ( 'foo %d %s' , 123 , 'text' ) ) ; Messages :: setTranslations ( [ 'foo' => 'boo' , 'foo %d %s' => '%d %s boo' , ] ) ; self :: assertEquals ( 'boo' , _ ( 'foo' ) ) ; self :: assertEquals ( '123 text boo' , _ ( 'foo %d %s' , 123 , 'text' ) ) ; }
Test basic function like get translation with and without custom dictionary.
Test basic function like get translation with and without custom dictionary .
// without custom dictionary // same but with a custom dictionary