summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDavey Shafik <davey@php.net>2020-10-27 10:18:04 +0000
committerGitHub <noreply@github.com>2020-10-27 10:18:04 +0000
commit8498f6410e7608b623ba2a6030726e5391dd7f4b (patch)
treef6d22d5d9f0bf3a5732ffcc7b91100b6588b3ec9 /tests
parente639fd80b4a2328d1b4f0429ee302ae915a99c71 (diff)
downloadphp7-mysql-shim-8498f6410e7608b623ba2a6030726e5391dd7f4b.zip
php7-mysql-shim-8498f6410e7608b623ba2a6030726e5391dd7f4b.tar.gz
php7-mysql-shim-8498f6410e7608b623ba2a6030726e5391dd7f4b.tar.bz2
Add missing warning from mysql_fetch_field()
Diffstat (limited to 'tests')
-rw-r--r--tests/MySqlShimTest.php11
1 files changed, 5 insertions, 6 deletions
diff --git a/tests/MySqlShimTest.php b/tests/MySqlShimTest.php
index 701cabd..875c5ed 100644
--- a/tests/MySqlShimTest.php
+++ b/tests/MySqlShimTest.php
@@ -1059,8 +1059,8 @@ class MySqlShimTest extends \Yoast\PHPUnitPolyfills\TestCases\TestCase
public function test_mysql_fetch_field_fail_invalid()
{
- // $this->expectWarning();
- // $this->expectWarningMessage("mysql_fetch_field() expects parameter 1 to be resource, boolean given");
+ $this->expectWarning();
+ $this->expectWarningMessage("mysql_fetch_field(): Bad field offset");
$this->getConnection();
@@ -1071,12 +1071,11 @@ class MySqlShimTest extends \Yoast\PHPUnitPolyfills\TestCases\TestCase
('six', '6', '6', '6', '6', '6', '6', '6', 'six', 'six', '6')"
);
- $result = mysql_query("SELECT * FROM testing WHERE one = 'six' LIMIT 1");
+ $result = mysql_query("SELECT one FROM testing WHERE one = 'six' LIMIT 1");
$this->assertNotFalse($result);
- for ($i = 0; $i <= 12; $i++) {
- $field = mysql_fetch_field($result, $i);
- }
+
+ $field = mysql_fetch_field($result, 2);
$this->assertFalse($field);
}