| 1 | <?php |
||
| 21 | class LanguageBaseTest extends \PHPUnit_Framework_TestCase{ |
||
| 22 | |||
| 23 | const LANGUAGES = [ |
||
| 24 | Chinese::class, |
||
| 25 | English::class, |
||
| 26 | French::class, |
||
| 27 | German::class, |
||
| 28 | Spanish::class, |
||
| 29 | ]; |
||
| 30 | |||
| 31 | public function testIterateLanguage(){ |
||
| 32 | foreach(self::LANGUAGES as $languageInterface){ |
||
| 33 | $reflectionClass = new ReflectionClass($languageInterface); |
||
| 34 | $lang = $reflectionClass->newInstance(); |
||
| 35 | |||
| 36 | foreach($lang as $key => $string){ |
||
| 37 | $this->assertEquals($lang->string($key, $languageInterface), $lang->{$key}($languageInterface)); |
||
| 38 | } |
||
| 39 | } |
||
| 40 | } |
||
| 41 | |||
| 42 | } |
||
| 43 |