1--TEST--
2PDO::ATTR_CONNECTION_STATUS
3--EXTENSIONS--
4pdo_mysql
5--SKIPIF--
6<?php
7    require_once __DIR__ . '/inc/mysql_pdo_test.inc';
8    MySQLPDOTest::skip();
9?>
10--FILE--
11    <?php
12    require_once __DIR__ . '/inc/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