summaryrefslogtreecommitdiffstats
path: root/tests/MySqlShimTest.php
diff options
context:
space:
mode:
authorDavey Shafik <me@daveyshafik.com>2017-01-08 16:15:33 -0800
committerDavey Shafik <me@daveyshafik.com>2017-01-08 16:15:33 -0800
commit8fee9378cf84a89c19a39042d8ce06c5850caf84 (patch)
treee4d827a4f96547992c14089c30fcddd1d774f840 /tests/MySqlShimTest.php
parentf3a6f930bd25fb08554486994637a02139f8ddca (diff)
downloadphp7-mysql-shim-8fee9378cf84a89c19a39042d8ce06c5850caf84.zip
php7-mysql-shim-8fee9378cf84a89c19a39042d8ce06c5850caf84.tar.gz
php7-mysql-shim-8fee9378cf84a89c19a39042d8ce06c5850caf84.tar.bz2
Add third argument to `mysql_db_name()`
Fixes #23
Diffstat (limited to 'tests/MySqlShimTest.php')
-rw-r--r--tests/MySqlShimTest.php17
1 files changed, 12 insertions, 5 deletions
diff --git a/tests/MySqlShimTest.php b/tests/MySqlShimTest.php
index 3cd86e2..7ffb704 100644
--- a/tests/MySqlShimTest.php
+++ b/tests/MySqlShimTest.php
@@ -840,11 +840,6 @@ class MySqlShimTest extends \PHPUnit_Framework_TestCase
mysql_escape_string("'\0\032\r\n\"\\");
}
- public function tearDown()
- {
- @mysql_close();
- }
-
public function test_mysql_select_db()
{
$this->getConnection();
@@ -866,6 +861,18 @@ class MySqlShimTest extends \PHPUnit_Framework_TestCase
$this->assertFalse(mysql_select_db('nonexistent'));
}
+ public function test_mysql_db_name()
+ {
+ $conn = $this->getConnection();
+ $dbs = mysql_list_dbs();
+ $this->assertEquals('information_schema', mysql_db_name($dbs, 0));
+ }
+
+ public function tearDown()
+ {
+ @mysql_close();
+ }
+
public static function setUpBeforeClass()
{
error_reporting(E_ALL & ~E_DEPRECATED);