diff options
author | Davey Shafik <me@daveyshafik.com> | 2016-10-03 12:23:30 -0700 |
---|---|---|
committer | Davey Shafik <me@daveyshafik.com> | 2016-10-03 12:24:01 -0700 |
commit | 19795ccf236ba2e2b58f88db0d93883ec334efcf (patch) | |
tree | 954c2da6738f42e08ec9d1ad970daaa3b324016c /tests | |
parent | efaec4da0ef401bcda83caffbb771228b2b88860 (diff) | |
download | php7-mysql-shim-19795ccf236ba2e2b58f88db0d93883ec334efcf.zip php7-mysql-shim-19795ccf236ba2e2b58f88db0d93883ec334efcf.tar.gz php7-mysql-shim-19795ccf236ba2e2b58f88db0d93883ec334efcf.tar.bz2 |
Don't trigger weird behavior in PHP 5.6 with extraneous args
Diffstat (limited to 'tests')
-rw-r--r-- | tests/MySqlShimTest.php | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/tests/MySqlShimTest.php b/tests/MySqlShimTest.php index 44a3a4e..ab6b3de 100644 --- a/tests/MySqlShimTest.php +++ b/tests/MySqlShimTest.php @@ -32,7 +32,7 @@ class MySqlShimTest extends \PHPUnit_Framework_TestCase } /** - * @requires PHP 7 + * @requires PHP 7.0.0 */ public function test_mysql_connect_defaults() { @@ -630,6 +630,13 @@ class MySqlShimTest extends \PHPUnit_Framework_TestCase $this->assertEquals(sizeof($results), mysql_num_rows($result)); + $function = function ($result) use ($function, $resultType) { + if ($resultType) { + return $function($result, $resultType); + } + return $function($result); + }; + $i = 0; while ($row = $function($result, $resultType)) { $this->assertEquals($results[$i], $row); @@ -937,17 +944,17 @@ class MySqlShimTest extends \PHPUnit_Framework_TestCase [ 'function' => 'mysql_fetch_array', 'results' => $assoc, - 'resulttype' => MYSQL_ASSOC + 'resultType' => MYSQL_ASSOC ], [ 'function' => 'mysql_fetch_array', 'results' => $array, - 'resulttype' => MYSQL_BOTH + 'resultType' => MYSQL_BOTH ], [ 'function' => 'mysql_fetch_array', 'results' => $numeric, - 'resulttype' => MYSQL_NUM + 'resultType' => MYSQL_NUM ], [ 'function' => 'mysql_fetch_assoc', |