From e52a3bff90c8f81cb1981e5ba587a2500b5b9596 Mon Sep 17 00:00:00 2001 From: Colin Williams Date: Fri, 19 Jun 2015 17:59:39 +0100 Subject: Add unit test for locales to ensure number of %d and %s placeholders are correct. --- tests/units/LocaleTest.php | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 tests/units/LocaleTest.php (limited to 'tests/units/LocaleTest.php') diff --git a/tests/units/LocaleTest.php b/tests/units/LocaleTest.php new file mode 100644 index 00000000..7f8dd7c9 --- /dev/null +++ b/tests/units/LocaleTest.php @@ -0,0 +1,29 @@ + $v) + { + if(strpos($k,'%B %e, %Y') !== false) + continue; + if(strpos($k,'%b %e, %Y') !== false) + continue; + foreach(array('%s', '%d') as $placeholder) + { + $this->assertEquals( + substr_count($k, '%s'), + substr_count($v, '%s'), + 'Incorrect number of ' . $placeholder . ' in ' . basename($l) .' translation of: ' . $k + ); + } + } + } + } +} -- cgit v1.2.3