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