Bladeren bron

Fixed indent, updated test

Dmitry Pikhno 13 jaren geleden
bovenliggende
commit
8b0b9ba892

+ 3 - 3
lib/Gedmo/Translatable/Mapping/Driver/Annotation.php

@@ -103,9 +103,9 @@ class Annotation implements AnnotationDriverInterface
                 }
                 // fields cannot be overrided and throws mapping exception
                 $config['fields'][] = $field;
-				if ($this->reader->getPropertyAnnotation($property, self::NOFALLBACK)) {
-					$config['nofallback'][] = $field;
-				}
+                if ($this->reader->getPropertyAnnotation($property, self::NOFALLBACK)) {
+                    $config['nofallback'][] = $field;
+                }
             }
             // locale property
             if ($locale = $this->reader->getPropertyAnnotation($property, self::LOCALE)) {

+ 3 - 3
lib/Gedmo/Translatable/Mapping/Driver/Xml.php

@@ -63,9 +63,9 @@ class Xml extends BaseXml
                 $field = $this->_getAttribute($mappingDoctrine, 'name');
                 if (isset($mapping->translatable)) {
                     $config['fields'][] = $field;
-					if (isset($mapping->nofallback)) {
-						$config['nofallback'][] = $field;
-					}
+                    if (isset($mapping->nofallback)) {
+                        $config['nofallback'][] = $field;
+                    }
                 }
             }
         }

+ 3 - 3
lib/Gedmo/Translatable/Mapping/Driver/Yaml.php

@@ -54,9 +54,9 @@ class Yaml extends File implements Driver
                     if (in_array('translatable', $fieldMapping['gedmo'])) {
                         // fields cannot be overrided and throws mapping exception
                         $config['fields'][] = $field;
-						if (in_array('nofallback', $fieldMapping['gedmo'])) {
-							$config['nofallback'][] = $field;
-						}
+                        if (in_array('nofallback', $fieldMapping['gedmo'])) {
+                            $config['nofallback'][] = $field;
+                        }
                     }
                 }
             }

+ 17 - 20
tests/Gedmo/Translatable/TranslatableTest.php

@@ -247,26 +247,23 @@ class TranslatableTest extends BaseTestCaseORM
         $this->assertCount(1, $translations);
     }
 
-	function shouldRespectNoFallbackAnnotation()
-	{
-		$article = new Article;
-		$article->setTitle('Euro2012');
-		$article->setViews(10);
-
-		$this->em->persist($article);
-		$this->em->flush();
-
-		$this->translatableListener->setTranslatableLocale('ua_UA');
-		$this->em->persist($article);
-		$this->em->flush();
-
-		$this->em->clear();
-		$this->translatableListener->setTranslationFallback(true);
-		$article = $this->em->find(self::ARTICLE, $article->getId());
-
-		$this->assertEquals('Euro2012', $article->getTitle());
-		$this->assertEmpty($article->getViews());
-	}
+    function shouldRespectNoFallbackAnnotation()
+    {
+        $article = new Article;
+        $article->setTitle('Euro2012');
+        $article->setViews(10);
+
+        $this->em->persist($article);
+        $this->em->flush();
+        $this->em->clear();
+
+        $this->translatableListener->setTranslatableLocale('ua_UA');
+        $this->translatableListener->setTranslationFallback(true);
+        $article = $this->em->find(self::ARTICLE, $article->getId());
+
+        $this->assertEquals('Euro2012', $article->getTitle());
+        $this->assertEmpty($article->getViews());
+    }
 
     protected function getUsedEntityFixtures()
     {