Browse Source

Forward port test for #7428

Rachman Chavik 10 years ago
parent
commit
2180fd076d
1 changed files with 14 additions and 0 deletions
  1. 14 0
      tests/TestCase/Database/Driver/MysqlTest.php

+ 14 - 0
tests/TestCase/Database/Driver/MysqlTest.php

@@ -128,4 +128,18 @@ class MysqlTest extends TestCase
             ->will($this->returnValue($connection));
         $driver->connect($config);
     }
+
+    /**
+     * Test isConnected
+     *
+     * @return void
+     */
+    public function testIsConnected() {
+        $connection = ConnectionManager::get('test');
+        $connection->disconnect();
+        $this->assertFalse($connection->isConnected(), 'Not connected now.');
+
+        $connection->connect();
+        $this->assertTrue($connection->isConnected(), 'Should be connected.');
+    }
 }