diff options
author | Swen van Zanten <info@hdsign.nl> | 2016-10-03 21:14:41 +0200 |
---|---|---|
committer | Davey Shafik <davey@php.net> | 2016-10-03 12:14:41 -0700 |
commit | efaec4da0ef401bcda83caffbb771228b2b88860 (patch) | |
tree | 44c99296eaec3d753921622a3c21f4b2caf9e873 /tests | |
parent | b1edab9eaffa1c2abcc3541a2304e679e5b8c90f (diff) | |
download | php7-mysql-shim-efaec4da0ef401bcda83caffbb771228b2b88860.zip php7-mysql-shim-efaec4da0ef401bcda83caffbb771228b2b88860.tar.gz php7-mysql-shim-efaec4da0ef401bcda83caffbb771228b2b88860.tar.bz2 |
Added the result type to the mysql_fetch_array function (#16)
* Added the result type to the mysql_fetch_array function
* Changed the 'resultType' variable to camelCase, added extra tests
* Fixed the mysql_fetch tests
Diffstat (limited to 'tests')
-rw-r--r-- | tests/MySqlShimTest.php | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/tests/MySqlShimTest.php b/tests/MySqlShimTest.php index 1a39ff3..44a3a4e 100644 --- a/tests/MySqlShimTest.php +++ b/tests/MySqlShimTest.php @@ -621,7 +621,7 @@ class MySqlShimTest extends \PHPUnit_Framework_TestCase /** * @dataProvider mysql_fetch_DataProvider */ - public function test_mysql_fetch($function, $results) + public function test_mysql_fetch($function, $results, $resultType = null) { $this->getConnection("shim_test"); @@ -631,7 +631,7 @@ class MySqlShimTest extends \PHPUnit_Framework_TestCase $this->assertEquals(sizeof($results), mysql_num_rows($result)); $i = 0; - while ($row = $function($result)) { + while ($row = $function($result, $resultType)) { $this->assertEquals($results[$i], $row); $i++; } @@ -936,7 +936,18 @@ class MySqlShimTest extends \PHPUnit_Framework_TestCase return [ [ 'function' => 'mysql_fetch_array', - 'results' => $array + 'results' => $assoc, + 'resulttype' => MYSQL_ASSOC + ], + [ + 'function' => 'mysql_fetch_array', + 'results' => $array, + 'resulttype' => MYSQL_BOTH + ], + [ + 'function' => 'mysql_fetch_array', + 'results' => $numeric, + 'resulttype' => MYSQL_NUM ], [ 'function' => 'mysql_fetch_assoc', |