1--TEST--
2PDO::ATTR_CONNECTION_STATUS
3--SKIPIF--
4<?php
5require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
6require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
7MySQLPDOTest::skip();
8$db = MySQLPDOTest::factory();
9?>
10--FILE--
11<?php
12	require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
13	$db = MySQLPDOTest::factory();
14
15	$status = $db->getAttribute(PDO::ATTR_CONNECTION_STATUS);
16	if (ini_get('unicode.semantics')) {
17		if (!is_unicode($status))
18			printf("[001] Expecting unicode, got '%s'\n", var_export($status, true));
19	} else {
20		if (!is_string($status))
21			printf("[002] Expecting string, got '%s'\n", var_export($status, true));
22	}
23
24	if ('' == $status)
25		printf("[003] Connection status string must not be empty\n");
26
27	if (false !== $db->setAttribute(PDO::ATTR_CONNECTION_STATUS, 'my own connection status'))
28		printf("[004] Changing read only attribute\n");
29
30	$status2 = $db->getAttribute(PDO::ATTR_CONNECTION_STATUS);
31	if ($status !== $status2)
32		printf("[005] Connection status should not have changed\n");
33
34	print "done!";
35?>
36--EXPECTF--
37done!
38