php-src/ext/mysqli/tests/mysqli_incomplete_initialization.phpt
Christoph M. Becker 5072321c55 Improve test portability
We have to ensure that the attempted connection to the MySQL server
fails, and do that by passing an unknown host instead of falling back
to localhost.
2020-08-14 15:33:02 +02:00

20 lines
386 B
PHP

--TEST--
Incomplete initialization edge case where mysql->mysql is NULL
--SKIPIF--
<?php
require_once('skipif.inc');
?>
--FILE--
<?php
$mysqli = new mysqli();
@$mysqli->__construct('doesnotexist');
$mysqli->close();
?>
--EXPECTF--
Fatal error: Uncaught Error: mysqli object is not fully initialized in %s:%d
Stack trace:
#0 %s(%d): mysqli->close()
#1 {main}
thrown in %s on line %d