HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux wordpress-ubuntu-s-2vcpu-4gb-fra1-01 5.4.0-169-generic #187-Ubuntu SMP Thu Nov 23 14:52:28 UTC 2023 x86_64
User: root (0)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/delta/wp-content/themes/delta/vendor/timber/timber/tests/test-timber-gettext.php
<?php

class TestTimberGettext extends Timber_UnitTestCase {

	function test__() {
		$context = Timber::context();
		$str = Timber::compile_string("{{ __('my_boo') }}", $context);
		$this->assertEquals(__('my_boo'), trim($str));
	}

	function testTranslate() {
		$context = Timber::context();
		$str = Timber::compile_string("{{ translate('my_boo') }}", $context);
		$this->assertEquals(translate('my_boo'), trim($str));
	}

	function test_e() {
		$context = Timber::context();
		$str = Timber::compile_string("{{ _e('my_boo') }}", $context);
    ob_start();
    _e('my_boo');
    $_e = ob_get_clean();
		$this->assertEquals($_e, trim($str));
	}

	function test_n() {
		$context = Timber::context();
		$str = Timber::compile_string("{{ _n('foo', 'foos', 1 ) }}", $context);
		$this->assertEquals(_n('foo', 'foos', 1 ), trim($str));
		$str = Timber::compile_string("{{ _n('foo', 'foos', 2 ) }}", $context);
		$this->assertEquals(_n('foo', 'foos', 2 ), trim($str));
	}

	function test_x() {
		$context = Timber::context();
		$str = Timber::compile_string("{{ _x('boo', 'my') }}", $context);
		$this->assertEquals(_x('boo', 'my'), trim($str));
	}

	function test_ex() {
		$context = Timber::context();
		$str = Timber::compile_string("{{ _ex('boo', 'my') }}", $context);
    ob_start();
    _ex('boo', 'my');
    $_ex = ob_get_clean();
		$this->assertEquals($_ex, trim($str));
	}

	function test_nx() {
		$context = Timber::context();
		$str = Timber::compile_string("{{ _nx('boo', 'boos', 1, 'my' ) }}", $context);
		$this->assertEquals(_nx('boo', 'boos', 1, 'my' ), trim($str));
		$str = Timber::compile_string("{{ _nx('boo', 'boos', 2, 'my' ) }}", $context);
		$this->assertEquals(_nx('boo', 'boos', 2, 'my' ), trim($str));
	}

}