From 49f9d185deaa084301d6f9c736de363b93254e6a Mon Sep 17 00:00:00 2001
From: "Fabio B. Silva" <fabio.bat.silva@gmail.com>
Date: Tue, 12 Jun 2012 09:47:40 -0300
Subject: [PATCH] Fix CS and test configuration

---
 lib/Doctrine/ORM/Configuration.php            |  2 +-
 .../ORM/Mapping/DefaultQuoteStrategy.php      |  8 ++++----
 .../Tests/ORM/Mapping/QuoteStrategyTest.php   | 19 +++++++++++++++++++
 3 files changed, 24 insertions(+), 5 deletions(-)

diff --git a/lib/Doctrine/ORM/Configuration.php b/lib/Doctrine/ORM/Configuration.php
index afdfd5e17..74367a90a 100644
--- a/lib/Doctrine/ORM/Configuration.php
+++ b/lib/Doctrine/ORM/Configuration.php
@@ -639,7 +639,7 @@ class Configuration extends \Doctrine\DBAL\Configuration
      */
     public function setQuoteStrategy(QuoteStrategy $quoteStrategy)
     {
-        $this->_attributes['quoteStrategy'] = $namingStrategy;
+        $this->_attributes['quoteStrategy'] = $quoteStrategy;
     }
 
     /**
diff --git a/lib/Doctrine/ORM/Mapping/DefaultQuoteStrategy.php b/lib/Doctrine/ORM/Mapping/DefaultQuoteStrategy.php
index 1470c0629..6d779f0e5 100644
--- a/lib/Doctrine/ORM/Mapping/DefaultQuoteStrategy.php
+++ b/lib/Doctrine/ORM/Mapping/DefaultQuoteStrategy.php
@@ -47,8 +47,8 @@ class DefaultQuoteStrategy implements QuoteStrategy
     public function getTableName(ClassMetadata $class, AbstractPlatform $platform)
     {
         return isset($class->table['quoted']) 
-                ? $platform->quoteIdentifier($class->table['name'])
-                : $class->table['name'];
+            ? $platform->quoteIdentifier($class->table['name'])
+            : $class->table['name'];
     }
 
     /**
@@ -57,8 +57,8 @@ class DefaultQuoteStrategy implements QuoteStrategy
     public function getSequenceName(array $definition, ClassMetadata $class, AbstractPlatform $platform)
     {
         return isset($definition['quoted'])
-                ? $platform->quoteIdentifier($definition['sequenceName'])
-                : $definition['sequenceName'];
+            ? $platform->quoteIdentifier($definition['sequenceName'])
+            : $definition['sequenceName'];
     }
 
     /**
diff --git a/tests/Doctrine/Tests/ORM/Mapping/QuoteStrategyTest.php b/tests/Doctrine/Tests/ORM/Mapping/QuoteStrategyTest.php
index 577c7a26e..23f02b451 100644
--- a/tests/Doctrine/Tests/ORM/Mapping/QuoteStrategyTest.php
+++ b/tests/Doctrine/Tests/ORM/Mapping/QuoteStrategyTest.php
@@ -44,6 +44,20 @@ class QuoteStrategyTest extends \Doctrine\Tests\OrmTestCase
         return $cm;
     }
 
+    public function testConfiguration()
+    {
+        $em     = $this->_getTestEntityManager();
+        $config = $em->getConfiguration();
+
+        $this->assertInstanceOf('Doctrine\ORM\Mapping\QuoteStrategy', $config->getQuoteStrategy());
+        $this->assertInstanceOf('Doctrine\ORM\Mapping\DefaultQuoteStrategy', $config->getQuoteStrategy());
+
+        $config->setQuoteStrategy(new MyQuoteStrategy());
+
+        $this->assertInstanceOf('Doctrine\ORM\Mapping\QuoteStrategy', $config->getQuoteStrategy());
+        $this->assertInstanceOf('Doctrine\Tests\ORM\Mapping\MyQuoteStrategy', $config->getQuoteStrategy());
+    }
+
     public function testGetColumnName()
     {
         $cm = $this->createClassMetadata('Doctrine\Tests\Models\CMS\CmsUser');
@@ -175,4 +189,9 @@ class QuoteStrategyTest extends \Doctrine\Tests\OrmTestCase
         $joinColumn = $cm->associationMappings['article']['joinColumns'][0];
         $this->assertEquals('"id"',$this->strategy->getReferencedJoinColumnName($joinColumn, $cm, $this->platform));
     }
+}
+
+class MyQuoteStrategy extends \Doctrine\ORM\Mapping\DefaultQuoteStrategy
+{
+
 }
\ No newline at end of file