xref: /php-src/ext/pdo/tests/bug_43663.phpt (revision c1fec9bb)
1--TEST--
2PDO Common: Bug #43663 (__call on classes derived from PDO)
3--EXTENSIONS--
4pdo
5--SKIPIF--
6<?php
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 TestClass 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 = PDOTest::factory(TestClass::class);
27$a->foo();
28$a->bar();
29?>
30--EXPECT--
31Called foo in TestClass
32Called bar in TestClass
33