summaryrefslogtreecommitdiff
path: root/tests/units/Locale/LocaleTest.php
blob: 6cace0d511a54f4df82dd844f46b12c09fbf4aae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php

require_once __DIR__.'/../Base.php';

class LocaleTest extends Base
{
    public function testLocales()
    {
        foreach(glob('app/Locale/*') as $file) {

            $locale = require($file . '/translations.php');

            foreach($locale as $k => $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, $placeholder),
                        substr_count($v, $placeholder),
                        'Incorrect number of ' . $placeholder . ' in ' . basename($file) .' translation of: ' . $k
                    );
                }
            }
        }
    }
}