Browse Source

Merge pull request #8482 from chinpei215/fakepdo-mock

Remove the stub method for quoteIdentifier()
José Lorenzo Rodríguez 10 years ago
parent
commit
0b5b3e878b

+ 1 - 6
tests/TestCase/Database/Schema/MysqlSchemaTest.php

@@ -1036,17 +1036,12 @@ SQL;
     protected function _getMockedDriver()
     {
         $driver = new \Cake\Database\Driver\Mysql();
-        $mock = $this->getMock('FakePdo', ['quote', 'quoteIdentifier']);
+        $mock = $this->getMock('FakePdo', ['quote']);
         $mock->expects($this->any())
             ->method('quote')
             ->will($this->returnCallback(function ($value) {
                 return "'$value'";
             }));
-        $mock->expects($this->any())
-            ->method('quoteIdentifier')
-            ->will($this->returnCallback(function ($value) {
-                return '`' . $value . '`';
-            }));
         $driver->connection($mock);
         return $driver;
     }

+ 1 - 6
tests/TestCase/Database/Schema/PostgresSchemaTest.php

@@ -1125,17 +1125,12 @@ SQL;
     protected function _getMockedDriver()
     {
         $driver = new \Cake\Database\Driver\Postgres();
-        $mock = $this->getMock('FakePdo', ['quote', 'quoteIdentifier']);
+        $mock = $this->getMock('FakePdo', ['quote']);
         $mock->expects($this->any())
             ->method('quote')
             ->will($this->returnCallback(function ($value) {
                 return "'$value'";
             }));
-        $mock->expects($this->any())
-            ->method('quoteIdentifier')
-            ->will($this->returnCallback(function ($value) {
-                return "'$value'";
-            }));
         $driver->connection($mock);
         return $driver;
     }

+ 1 - 6
tests/TestCase/Database/Schema/SqliteSchemaTest.php

@@ -974,17 +974,12 @@ SQL;
     protected function _getMockedDriver()
     {
         $driver = new \Cake\Database\Driver\Sqlite();
-        $mock = $this->getMock('FakePdo', ['quote', 'quoteIdentifier', 'prepare']);
+        $mock = $this->getMock('FakePdo', ['quote', 'prepare']);
         $mock->expects($this->any())
             ->method('quote')
             ->will($this->returnCallback(function ($value) {
                 return '"' . $value . '"';
             }));
-        $mock->expects($this->any())
-            ->method('quoteIdentifier')
-            ->will($this->returnCallback(function ($value) {
-                return '"' . $value . '"';
-            }));
         $driver->connection($mock);
         return $driver;
     }

+ 1 - 6
tests/TestCase/Database/Schema/SqlserverSchemaTest.php

@@ -852,17 +852,12 @@ SQL;
     protected function _getMockedDriver()
     {
         $driver = new \Cake\Database\Driver\Sqlserver();
-        $mock = $this->getMock('FakePdo', ['quote', 'quoteIdentifier']);
+        $mock = $this->getMock('FakePdo', ['quote']);
         $mock->expects($this->any())
             ->method('quote')
             ->will($this->returnCallback(function ($value) {
                 return '[' . $value . ']';
             }));
-        $mock->expects($this->any())
-            ->method('quoteIdentifier')
-            ->will($this->returnCallback(function ($value) {
-                return '[' . $value . ']';
-            }));
         $driver->connection($mock);
         return $driver;
     }