소스 검색

updated tests to provide more useful examples

everzet 13 년 전
부모
커밋
4a6cd217f1
2개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 2 2
      tests/Gedmo/Translator/Fixture/Person.php
  2. 1 1
      tests/Gedmo/Translator/TranslatableTest.php

+ 2 - 2
tests/Gedmo/Translator/Fixture/Person.php

@@ -73,9 +73,9 @@ class Person
         $this->translations = new ArrayCollection();
     }
 
-    public function translate($locale = null)
+    public function translate($locale = 'en')
     {
-        if (null === $locale) {
+        if ('en' === $locale) {
             return $this;
         }
 

+ 1 - 1
tests/Gedmo/Translator/TranslatableTest.php

@@ -89,7 +89,7 @@ class TranslatableTest extends BaseTestCaseORM
     public function testTranslatableWithMagicProperties()
     {
         $person = new Person();
-        $person->setName('Jen');
+        $person->translate('en')->setName('Jen');
         $person->translate('ru_RU')->name = 'Женя';
         $person->translate('ru_RU')->description = 'multilingual description';