summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSwen van Zanten <info@hdsign.nl>2016-10-03 21:14:41 +0200
committerDavey Shafik <davey@php.net>2016-10-03 12:14:41 -0700
commitefaec4da0ef401bcda83caffbb771228b2b88860 (patch)
tree44c99296eaec3d753921622a3c21f4b2caf9e873 /tests
parentb1edab9eaffa1c2abcc3541a2304e679e5b8c90f (diff)
downloadphp7-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.php17
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',