xref: /PHP-8.0/ext/pdo/tests/bug_43663.phpt (revision 7aacc705)
1--TEST--
2PDO Common: Bug #43663 (__call on classes derived from PDO)
3--SKIPIF--
4<?php
5if (!extension_loaded('pdo')) die('skip');
6if (!extension_loaded('pdo_sqlite')) die('skip');
7$dir = getenv('REDIR_TEST_DIR');
8if (false == $dir) die('skip no driver');
9require_once $dir . 'pdo_test.inc';
10PDOTest::skip();
11?>
12--FILE--
13<?php
14class test extends PDO{
15    function __call($name, array $args) {
16        echo "Called $name in ".__CLASS__."\n";
17    }
18    function foo() {
19        echo "Called foo in ".__CLASS__."\n";
20    }
21}
22
23if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/');
24require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
25
26$a = new test('sqlite::memory:');
27$a->foo();
28$a->bar();
29?>
30--EXPECT--
31Called foo in test
32Called bar in test
33