comparison core/modules/locale/tests/src/Functional/LocaleJavascriptTranslationTest.php @ 18:af1871eacc83

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:33:08 +0100
parents 129ea1e6d783
children
comparison
equal deleted inserted replaced
17:129ea1e6d783 18:af1871eacc83
1 <?php 1 <?php
2 2
3 namespace Drupal\Tests\locale\Functional; 3 namespace Drupal\Tests\locale\Functional;
4 4
5 use Drupal\Component\Gettext\PoItem;
5 use Drupal\Core\Language\LanguageInterface; 6 use Drupal\Core\Language\LanguageInterface;
6 use Drupal\Tests\BrowserTestBase; 7 use Drupal\Tests\BrowserTestBase;
7 use Drupal\Component\Render\FormattableMarkup; 8 use Drupal\Component\Render\FormattableMarkup;
8 9
9 /** 10 /**
49 $source_strings = []; 50 $source_strings = [];
50 foreach ($strings as $string) { 51 foreach ($strings as $string) {
51 $source_strings[$string->source] = $string->context; 52 $source_strings[$string->source] = $string->context;
52 } 53 }
53 54
54 $etx = LOCALE_PLURAL_DELIMITER; 55 $etx = PoItem::DELIMITER;
55 // List of all strings that should be in the file. 56 // List of all strings that should be in the file.
56 $test_strings = [ 57 $test_strings = [
57 'Standard Call t' => '', 58 'Standard Call t' => '',
58 'Whitespace Call t' => '', 59 'Whitespace Call t' => '',
59 60
83 "Context !key Args plural{$etx}Context !key Args @count plural" => 'Context string', 84 "Context !key Args plural{$etx}Context !key Args @count plural" => 'Context string',
84 85
85 "Context Unquoted plural{$etx}Context Unquoted @count plural" => 'Context string unquoted', 86 "Context Unquoted plural{$etx}Context Unquoted @count plural" => 'Context string unquoted',
86 "Context Single Quoted plural{$etx}Context Single Quoted @count plural" => 'Context string single quoted', 87 "Context Single Quoted plural{$etx}Context Single Quoted @count plural" => 'Context string single quoted',
87 "Context Double Quoted plural{$etx}Context Double Quoted @count plural" => 'Context string double quoted', 88 "Context Double Quoted plural{$etx}Context Double Quoted @count plural" => 'Context string double quoted',
89
90 "No count argument plural - singular{$etx}No count argument plural - plural" => '',
88 ]; 91 ];
89 92
90 // Assert that all strings were found properly. 93 // Assert that all strings were found properly.
91 foreach ($test_strings as $str => $context) { 94 foreach ($test_strings as $str => $context) {
92 $args = ['%source' => $str, '%context' => $context]; 95 $args = ['%source' => $str, '%context' => $context];