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