toBeTrue(); expect($verdict['translated'])->toBe('Version 1.3.0'); }); test('the unconditionally declared translation helpers are unaffected', function () { $verdict = i18n_fallback_verdict(); // These are plain top level declarations, so PHP hoists them and the early // return never hid them. Asserted so a future move of __() that also moves // these is caught. expect($verdict['esc_exists'])->toBeTrue(); expect($verdict['gettext_exists'])->toBeTrue(); }); test('__() is declared before the fallback can return', function () { $src = file_get_contents(dirname(__DIR__, 2) . '/include/global_languages.php'); $declared = strpos($src, 'function __() : string'); $fallback = strpos($src, 'load_fallback_procedure();'); expect($declared)->not->toBeFalse(); expect($fallback)->not->toBeFalse(); expect($declared)->toBeLessThan($fallback); });