whoami7 - Manager
:
/
home
/
creaupfw
/
public_html
/
wp-includes
/
assets
/
Upload File:
files >> /home/creaupfw/public_html/wp-includes/assets/tests.tar
amqpconnection_setHost.phpt 0000644 00000000471 15031735151 0012173 0 ustar 00 --TEST-- AMQPConnection setHost --SKIPIF-- <?php if (!extension_loaded("amqp")) print "skip AMQP extension is not loaded"; ?> --FILE-- <?php $cnn = new AMQPConnection(); var_dump($cnn->getHost()); $cnn->setHost('nonexistent'); var_dump($cnn->getHost()); --EXPECTF-- string(9) "localhost" string(11) "nonexistent" amqpconnection_setLogin.phpt 0000644 00000000677 15031735151 0012336 0 ustar 00 --TEST-- AMQPConnection setLogin --SKIPIF-- <?php if (!extension_loaded("amqp")) print "skip AMQP extension is not loaded"; elseif (!getenv("PHP_AMQP_HOST")) print "skip PHP_AMQP_HOST environment variable is not set"; ?> --FILE-- <?php $cnn = new AMQPConnection(); $cnn->setHost(getenv('PHP_AMQP_HOST')); var_dump($cnn->getLogin()); $cnn->setLogin('nonexistent'); var_dump($cnn->getLogin()); --EXPECTF-- string(5) "guest" string(11) "nonexistent" amqpconnection_setReadTimeout_float.phpt 0000644 00000000740 15031735151 0014664 0 ustar 00 --TEST-- AMQPConnection setReadTimeout float --SKIPIF-- <?php if (!extension_loaded("amqp")) print "skip AMQP extension is not loaded"; elseif (!getenv("PHP_AMQP_HOST")) print "skip PHP_AMQP_HOST environment variable is not set"; ?> --FILE-- <?php $cnn = new AMQPConnection(); $cnn->setHost(getenv('PHP_AMQP_HOST')); $cnn->setReadTimeout(.34); var_dump($cnn->getReadTimeout()); $cnn->setReadTimeout(4.7e-2); var_dump($cnn->getReadTimeout());?> --EXPECT-- float(0.34) float(0.047) amqpconnection_construct_with_write_timeout.phpt 0000644 00000000526 15031735151 0016602 0 ustar 00 --TEST-- AMQPConnection constructor with write_timeout parameter in $cnntials --SKIPIF-- <?php if (!extension_loaded("amqp")) print "skip AMQP extension is not loaded"; ?> --FILE-- <?php $credentials = array('write_timeout' => 303.303); $cnn = new AMQPConnection($credentials); var_dump($cnn->getWriteTimeout()); ?> --EXPECT-- float(303.303) amqpconnection_setVhost.phpt 0000644 00000000673 15031735152 0012366 0 ustar 00 --TEST-- AMQPConnection setVhost --SKIPIF-- <?php if (!extension_loaded("amqp")) print "skip AMQP extension is not loaded"; elseif (!getenv("PHP_AMQP_HOST")) print "skip PHP_AMQP_HOST environment variable is not set"; ?> --FILE-- <?php $cnn = new AMQPConnection(); $cnn->setHost(getenv('PHP_AMQP_HOST')); var_dump($cnn->getVhost()); $cnn->setVhost('nonexistent'); var_dump($cnn->getVhost()); --EXPECTF-- string(1) "/" string(11) "nonexistent" amqpconnection_construct_with_connection_name.phpt 0000644 00000001137 15031735152 0017041 0 ustar 00 --TEST-- AMQPConnection constructor with connection_name parameter in credentials --SKIPIF-- <?php if (!extension_loaded("amqp")) print "skip AMQP extension is not loaded"; ?> --FILE-- <?php // Test connection name as a string $credentials = array('connection_name' => "custom connection name"); $cnn = new AMQPConnection($credentials); var_dump($cnn->getConnectionName()); // Test explicitly setting connection name as null $credentials = array('connection_name' => null); $cnn = new AMQPConnection($credentials); var_dump($cnn->getConnectionName()); ?> --EXPECT-- string(22) "custom connection name" NULL amqpconnection_setPort_int.phpt 0000644 00000000701 15031735152 0013051 0 ustar 00 --TEST-- AMQPConnection constructor --SKIPIF-- <?php if (!extension_loaded("amqp")) print "skip AMQP extension is not loaded"; elseif (!getenv("PHP_AMQP_HOST")) print "skip PHP_AMQP_HOST environment variable is not set"; ?> --FILE-- <?php $cnn = new AMQPConnection(); $cnn->setHost(getenv('PHP_AMQP_HOST')); $port = 12345; var_dump($cnn->setPort($port)); echo $cnn->getPort(), PHP_EOL; echo gettype($port), PHP_EOL; ?> --EXPECT-- NULL 12345 integer amqpconnection_construct_params_by_value.phpt 0000644 00000002020 15031735152 0016010 0 ustar 00 --TEST-- Params are passed by value in AMQPConnection::__construct() --SKIPIF-- <?php if (!extension_loaded("amqp")) print "skip AMQP extension is not loaded"; ?> --FILE-- <?php $params = [ 'host' => 'localhost', 'port' => 5432, 'login' => 'login', 'password' => 'password', 'read_timeout' => 10, 'write_timeout' => 10, 'connect_timeout' => 10, 'rpc_timeout' => 10, 'connection_name' => 'custom_connection_name' ]; $cnn = new AMQPConnection($params); echo gettype($params['host']) . PHP_EOL; echo gettype($params['port']) . PHP_EOL; echo gettype($params['login']) . PHP_EOL; echo gettype($params['password']) . PHP_EOL; echo gettype($params['read_timeout']) . PHP_EOL; echo gettype($params['write_timeout']) . PHP_EOL; echo gettype($params['connect_timeout']) . PHP_EOL; echo gettype($params['rpc_timeout']) . PHP_EOL; echo gettype($params['connection_name']) . PHP_EOL; --EXPECT-- string integer string string integer integer integer integer string amqpconnection_setWriteTimeout_out_of_range.phpt 0000644 00000001047 15031735152 0016447 0 ustar 00 --TEST-- AMQPConnection setWriteTimeout out of range --SKIPIF-- <?php if (!extension_loaded("amqp")) print "skip AMQP extension is not loaded"; elseif (!getenv("PHP_AMQP_HOST")) print "skip PHP_AMQP_HOST environment variable is not set"; ?> --FILE-- <?php $cnn = new AMQPConnection(); $cnn->setHost(getenv('PHP_AMQP_HOST')); try { $cnn->setWriteTimeout(-1); } catch (Exception $e) { echo get_class($e); echo PHP_EOL; echo $e->getMessage(); } ?> --EXPECT-- AMQPConnectionException Parameter 'writeTimeout' must be greater than or equal to zero. amqpconnection_setWriteTimeout_int.phpt 0000644 00000000620 15031735152 0014566 0 ustar 00 --TEST-- AMQPConnection setWriteTimeout int --SKIPIF-- <?php if (!extension_loaded("amqp")) print "skip AMQP extension is not loaded"; elseif (!getenv("PHP_AMQP_HOST")) print "skip PHP_AMQP_HOST environment variable is not set"; ?> --FILE-- <?php $cnn = new AMQPConnection(); $cnn->setHost(getenv('PHP_AMQP_HOST')); $cnn->setWriteTimeout(3); var_dump($cnn->getWriteTimeout()); ?> --EXPECT-- float(3) testtest.phpt 0000644 00000003421 15031735152 0007322 0 ustar 00 --TEST-- Test the tests --FILE-- <?php foreach (glob(__DIR__ . '/*.phpt') as $test) { if ($test === __FILE__ . 't') { continue; } $content = file_get_contents($test); if (!$content) { printf("%s could not be read\n", basename($test)); continue; } if (strpos($content, "\n--SKIPIF--\n") == false) { printf("%s does not contain SKIPIF section\n", basename($test)); continue; } if (!preg_match('/--FILE--(?P<testCode>.*?)--[A-Z]+--/s', $content, $matches)) { printf("%s TEST section cannot be parsed\n", basename($test)); continue; } ['testCode' => $testCode] = $matches; if (!preg_match('/--SKIPIF--(?P<skipCode>.*?)--[A-Z]+--/s', $content, $matches)) { printf("%s SKIPIF section cannot be parsed\n", basename($test)); continue; } ['skipCode' => $skipCode] = $matches; if (!preg_match('/if\s*\(!extension_loaded\("amqp"\)\)\s*\{?\s*print "skip AMQP extension is not loaded";/', $skipCode)) { printf("%s --SKIP-- does not check for the extension being present\n", basename($test)); continue; } $hostVars = ['PHP_AMQP_HOST', 'PHP_AMQP_SSL_HOST']; foreach ($hostVars as $hostVar) { if (strpos($testCode, $hostVar) !== false && !preg_match('/!getenv\(["\']' . $hostVar . '/', $skipCode)) { printf("%s --TEST-- contains reference to %s but --SKIP-- does not check for it\n", basename($test), $hostVar); continue 2; } if (strpos($testCode, $hostVar) === false && strpos($skipCode, $hostVar) !== false) { printf("%s --TEST-- contains no reference to %s but --SKIP-- checks for reference\n", basename($test), $hostVar); continue 2; } } } ?> ==DONE== --EXPECT-- ==DONE== amqpconnection_setWriteTimeout_string.phpt 0000644 00000000753 15031735152 0015311 0 ustar 00 --TEST-- AMQPConnection setWriteTimeout string --SKIPIF-- <?php if (!extension_loaded("amqp")) print "skip AMQP extension is not loaded"; elseif (!getenv("PHP_AMQP_HOST")) print "skip PHP_AMQP_HOST environment variable is not set"; ?> --FILE-- <?php $cnn = new AMQPConnection(); $cnn->setHost(getenv('PHP_AMQP_HOST')); $cnn->setWriteTimeout(".34"); var_dump($cnn->getWriteTimeout()); $cnn->setWriteTimeout("4.7e-2"); var_dump($cnn->getWriteTimeout()); ?> --EXPECT-- float(0.34) float(0.047) amqpconnection_setRpcTimeout_out_of_range.phpt 0000644 00000001041 15031735152 0016073 0 ustar 00 --TEST-- AMQPConnection setRpcTimeout out of range --SKIPIF-- <?php if (!extension_loaded("amqp")) print "skip AMQP extension is not loaded"; elseif (!getenv("PHP_AMQP_HOST")) print "skip PHP_AMQP_HOST environment variable is not set"; ?> --FILE-- <?php $cnn = new AMQPConnection(); $cnn->setHost(getenv('PHP_AMQP_HOST')); try { $cnn->setRpcTimeout(-1); } catch (Exception $e) { echo get_class($e); echo PHP_EOL; echo $e->getMessage(); } ?> --EXPECT-- AMQPConnectionException Parameter 'rpcTimeout' must be greater than or equal to zero. amqpconnection_setReadTimeout_int.phpt 0000644 00000000615 15031735152 0014353 0 ustar 00 --TEST-- AMQPConnection setReadTimeout int --SKIPIF-- <?php if (!extension_loaded("amqp")) print "skip AMQP extension is not loaded"; elseif (!getenv("PHP_AMQP_HOST")) print "skip PHP_AMQP_HOST environment variable is not set"; ?> --FILE-- <?php $cnn = new AMQPConnection(); $cnn->setHost(getenv('PHP_AMQP_HOST')); $cnn->setReadTimeout(3); var_dump($cnn->getReadTimeout()); ?> --EXPECT-- float(3) amqpconnection_setReadTimeout_string.phpt 0000644 00000000745 15031735152 0015073 0 ustar 00 --TEST-- AMQPConnection setReadTimeout string --SKIPIF-- <?php if (!extension_loaded("amqp")) print "skip AMQP extension is not loaded"; elseif (!getenv("PHP_AMQP_HOST")) print "skip PHP_AMQP_HOST environment variable is not set"; ?> --FILE-- <?php $cnn = new AMQPConnection(); $cnn->setHost(getenv('PHP_AMQP_HOST')); $cnn->setReadTimeout(".34"); var_dump($cnn->getReadTimeout()); $cnn->setReadTimeout("4.7e-2"); var_dump($cnn->getReadTimeout());?> --EXPECT-- float(0.34) float(0.047) amqpconnection_setSaslMethod_invalid.phpt 0000644 00000001075 15031735153 0015032 0 ustar 00 --TEST-- AMQPConnection setSaslMethod invalid --SKIPIF-- <?php if (!extension_loaded("amqp")) print "skip AMQP extension is not loaded"; elseif (!getenv("PHP_AMQP_HOST")) print "skip PHP_AMQP_HOST environment variable is not set"; ?> --FILE-- <?php $cnn = new AMQPConnection(); $cnn->setHost(getenv('PHP_AMQP_HOST')); try { $cnn->setSaslMethod(-1); } catch (Exception $e) { echo get_class($e); echo PHP_EOL; echo $e->getMessage(); } ?> --EXPECT-- AMQPConnectionException Invalid SASL method given. Method must be AMQP_SASL_METHOD_PLAIN or AMQP_SASL_METHOD_EXTERNAL. amqpconnection_setTimeout_int.phpt 0000644 00000001061 15031735153 0013554 0 ustar 00 --TEST-- AMQPConnection setTimeout int --SKIPIF-- <?php if (!extension_loaded("amqp")) print "skip AMQP extension is not loaded"; ?> --FILE-- <?php $cnn = new AMQPConnection(); $cnn->setTimeout(3); var_dump($cnn->getTimeout()); ?> --EXPECTF-- %s: AMQPConnection::setTimeout(): AMQPConnection::setTimeout($timeout) method is deprecated; use AMQPConnection::setReadTimeout($timeout) instead in %s on line 3 %s: AMQPConnection::getTimeout(): AMQPConnection::getTimeout() method is deprecated; use AMQPConnection::getReadTimeout() instead in %s on line 4 float(3) amqpconnection_setWriteTimeout_float.phpt 0000644 00000000745 15031735153 0015112 0 ustar 00 --TEST-- AMQPConnection setWriteTimeout float --SKIPIF-- <?php if (!extension_loaded("amqp")) print "skip AMQP extension is not loaded"; elseif (!getenv("PHP_AMQP_HOST")) print "skip PHP_AMQP_HOST environment variable is not set"; ?> --FILE-- <?php $cnn = new AMQPConnection(); $cnn->setHost(getenv('PHP_AMQP_HOST')); $cnn->setWriteTimeout(.34); var_dump($cnn->getWriteTimeout()); $cnn->setWriteTimeout(4.7e-2); var_dump($cnn->getWriteTimeout());?> --EXPECT-- float(0.34) float(0.047) amqpconnection_setTimeout_out_of_range.phpt 0000644 00000001065 15031735153 0015435 0 ustar 00 --TEST-- AMQPConnection setTimeout out of range --SKIPIF-- <?php if (!extension_loaded("amqp")) print "skip AMQP extension is not loaded"; ?> --FILE-- <?php $cnn = new AMQPConnection(); try { $cnn->setTimeout(-1); } catch (Exception $e) { echo get_class($e); echo PHP_EOL; echo $e->getMessage(); } ?> --EXPECTF-- %s: AMQPConnection::setTimeout(): AMQPConnection::setTimeout($timeout) method is deprecated; use AMQPConnection::setReadTimeout($timeout) instead in %s on line 4 AMQPConnectionException Parameter 'timeout' must be greater than or equal to zero. amqpqueue_declare_with_stalled_reference.phpt 0000644 00000001506 15031735153 0015711 0 ustar 00 --TEST-- AMQPQueue - declare with stalled reference --SKIPIF-- <?php if (!extension_loaded("amqp")) print "skip AMQP extension is not loaded"; ?> --FILE-- <?php class ConnectionMock extends AMQPConnection { public function __construct(array $credentials = array()) { } } class ChannelMock extends AMQPChannel { public function __construct(AMQPConnection $amqp_connection) { } } class QueueMock extends \AMQPQueue { public function __construct(AMQPChannel $amqp_channel) { } } $cnn = new ConnectionMock(); $ch = new ChannelMock($cnn); $e = new QueueMock($ch); try { $e->declareQueue(); } catch (\Exception $e) { echo get_class($e), "({$e->getCode()}): ", $e->getMessage(), PHP_EOL; } ?> --EXPECT-- AMQPChannelException(0): Could not declare queue. Stale reference to the channel object. ini_validation_failure.phpt 0000644 00000010636 15031735153 0012152 0 ustar 00 --TEST-- Bad INI settings are rejected --SKIPIF-- <?php if (!extension_loaded("amqp")) print "skip AMQP extension is not loaded"; ?> --INI-- amqp.host=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx amqp.vhost=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx amqp.port=-1 amqp.login=00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 amqp.password=00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 amqp.read_timeout=-1 amqp.write_timeout=-1 amqp.connect_timeout=-1 amqp.rpc_timeout=-1 amqp.timeout=-1 amqp.prefetch_count=-1 amqp.prefetch_size=-1 amqp.global_prefetch_count=-1 amqp.global_prefetch_size=-1 amqp.heartbeat=-1 amqp.channel_max=257 amqp.frame_max=-1 --FILE-- <?php var_dump(ini_get('amqp.host')); var_dump(ini_get('amqp.vhost')); var_dump(ini_get('amqp.port')); var_dump(ini_get('amqp.login')); var_dump(ini_get('amqp.password')); var_dump(ini_get('amqp.read_timeout')); var_dump(ini_get('amqp.write_timeout')); var_dump(ini_get('amqp.connect_timeout')); var_dump(ini_get('amqp.rpc_timeout')); var_dump(ini_get('amqp.timeout')); var_dump(ini_get('amqp.prefetch_count')); var_dump(ini_get('amqp.prefetch_size')); var_dump(ini_get('amqp.global_prefetch_count')); var_dump(ini_get('amqp.global_prefetch_size')); var_dump(ini_get('amqp.heartbeat')); var_dump(ini_get('amqp.channel_max')); var_dump(ini_get('amqp.frame_max')); ?> ==DONE== --EXPECT-- string(9) "localhost" string(1) "/" string(4) "5672" string(5) "guest" string(5) "guest" string(1) "0" string(1) "0" string(1) "0" string(1) "0" string(0) "" string(1) "3" string(1) "0" string(1) "0" string(1) "0" string(1) "0" string(3) "256" string(6) "131072" ==DONE== amqpconnection_setTimeout_string.phpt 0000644 00000001667 15031735153 0014304 0 ustar 00 --TEST-- AMQPConnection setTimeout string --SKIPIF-- <?php if (!extension_loaded("amqp")) print "skip AMQP extension is not loaded"; ?> --FILE-- <?php $cnn = new AMQPConnection(); $cnn->setTimeout(".34"); var_dump($cnn->getTimeout()); $cnn->setTimeout("4.7e-2"); var_dump($cnn->getTimeout());?> --EXPECTF-- %s: AMQPConnection::setTimeout(): AMQPConnection::setTimeout($timeout) method is deprecated; use AMQPConnection::setReadTimeout($timeout) instead in %s on line 3 %s: AMQPConnection::getTimeout(): AMQPConnection::getTimeout() method is deprecated; use AMQPConnection::getReadTimeout() instead in %s on line 4 float(0.34) %s: AMQPConnection::setTimeout(): AMQPConnection::setTimeout($timeout) method is deprecated; use AMQPConnection::setReadTimeout($timeout) instead in %s on line 5 %s: AMQPConnection::getTimeout(): AMQPConnection::getTimeout() method is deprecated; use AMQPConnection::getReadTimeout() instead in %s on line 6 float(0.047) amqpconnection_setReadTimeout_out_of_range.phpt 0000644 00000000636 15031735153 0016234 0 ustar 00 --TEST-- AMQPConnection setReadTimeout out of range --SKIPIF-- <?php if (!extension_loaded("amqp")) print "skip AMQP extension is not loaded"; ?> --FILE-- <?php $cnn = new AMQPConnection(); try { $cnn->setReadTimeout(-1); } catch (Exception $e) { echo get_class($e); echo PHP_EOL; echo $e->getMessage(); } ?> --EXPECT-- AMQPConnectionException Parameter 'readTimeout' must be greater than or equal to zero. amqpconnection_nullable_setters.phpt 0000644 00000001673 15031735153 0014120 0 ustar 00 --TEST-- AMQPConnection - setters and nullability --SKIPIF-- <?php if (!extension_loaded("amqp")) print "skip AMQP extension is not loaded"; ?> --FILE-- <?php $c = new AMQPConnection(); $c->setKey('key'); var_dump($c->getKey()); $c->setKey(null); var_dump($c->getKey()); $c->setKey(''); var_dump($c->getKey()); $c->setCert('cert'); var_dump($c->getCert()); $c->setCert(null); var_dump($c->getCert()); $c->setCert(''); var_dump($c->getCert()); $c->setCACert('cacert'); var_dump($c->getCACert()); $c->setCACert(null); var_dump($c->getCACert()); $c->setCACert(''); var_dump($c->getCACert()); $c->setConnectionName('con'); var_dump($c->getConnectionName()); $c->setConnectionName(null); var_dump($c->getConnectionName()); $c->setConnectionName(''); var_dump($c->getConnectionName()); ?> ==DONE== --EXPECT-- string(3) "key" NULL string(0) "" string(4) "cert" NULL string(0) "" string(6) "cacert" NULL string(0) "" string(3) "con" NULL string(0) "" ==DONE== amqpconnection_construct_with_verify_false.phpt 0000644 00000000476 15031735153 0016366 0 ustar 00 --TEST-- AMQPConnection constructor with verify parameter set to false in $params --SKIPIF-- <?php if (!extension_loaded("amqp")) print "skip AMQP extension is not loaded"; ?> --FILE-- <?php $params = array('verify' => false); $cnn = new AMQPConnection($params); var_dump($cnn->getVerify()); ?> --EXPECT-- bool(false) amqpconnection_setRpcTimeout_float.phpt 0000644 00000001107 15031735153 0014535 0 ustar 00 --TEST-- AMQPConnection setRpcTimeout float --SKIPIF-- <?php if (!extension_loaded("amqp")) print "skip AMQP extension is not loaded"; elseif (!getenv("PHP_AMQP_HOST")) print "skip PHP_AMQP_HOST environment variable is not set"; ?> --FILE-- <?php $timeout = .34; $cnn = new AMQPConnection(); $cnn->setHost(getenv('PHP_AMQP_HOST')); $cnn->setRpcTimeout($timeout); var_dump($cnn->getRpcTimeout()); var_dump($timeout); $timeout = 4.7e-2; $cnn->setRpcTimeout($timeout); var_dump($cnn->getRpcTimeout()); var_dump($timeout); ?> --EXPECT-- float(0.34) float(0.34) float(0.047) float(0.047) amqpbasicproperties_nullability.phpt 0000644 00000003456 15031735153 0014141 0 ustar 00 --TEST-- AMQPBasicProperties - explicit nullability --SKIPIF-- <?php if (!extension_loaded("amqp")) print "skip AMQP extension is not loaded"; ?> --FILE-- <?php require '_test_helpers.php.inc'; $props = new AMQPBasicProperties( null, null, array('test' => 'headers'), 42, 24, null, null, null, null, null, null, null, null, null ); var_dump($props); dump_methods($props); ?> --EXPECT-- object(AMQPBasicProperties)#1 (14) { ["contentType":"AMQPBasicProperties":private]=> NULL ["contentEncoding":"AMQPBasicProperties":private]=> NULL ["headers":"AMQPBasicProperties":private]=> array(1) { ["test"]=> string(7) "headers" } ["deliveryMode":"AMQPBasicProperties":private]=> int(42) ["priority":"AMQPBasicProperties":private]=> int(24) ["correlationId":"AMQPBasicProperties":private]=> NULL ["replyTo":"AMQPBasicProperties":private]=> NULL ["expiration":"AMQPBasicProperties":private]=> NULL ["messageId":"AMQPBasicProperties":private]=> NULL ["timestamp":"AMQPBasicProperties":private]=> NULL ["type":"AMQPBasicProperties":private]=> NULL ["userId":"AMQPBasicProperties":private]=> NULL ["appId":"AMQPBasicProperties":private]=> NULL ["clusterId":"AMQPBasicProperties":private]=> NULL } AMQPBasicProperties getContentType(): NULL getContentEncoding(): NULL getHeaders(): array(1) { ["test"]=> string(7) "headers" } getDeliveryMode(): int(42) getPriority(): int(24) getCorrelationId(): NULL getReplyTo(): NULL getExpiration(): NULL getMessageId(): NULL getTimestamp(): NULL getType(): NULL getUserId(): NULL getAppId(): NULL getClusterId(): NULL amqpconnection_setPort_out_of_range.phpt 0000644 00000000760 15031735154 0014735 0 ustar 00 --TEST-- AMQPConnection setPort with int out of range --SKIPIF-- <?php if (!extension_loaded("amqp")) print "skip AMQP extension is not loaded"; elseif (!getenv("PHP_AMQP_HOST")) print "skip PHP_AMQP_HOST environment variable is not set"; ?> --FILE-- <?php $cnn = new AMQPConnection(); $cnn->setHost(getenv('PHP_AMQP_HOST')); try { $cnn->setPort(1234567890); } catch (Exception $e) { echo $e->getMessage(); } ?> --EXPECT-- Parameter 'port' must be a valid port number between 1 and 65535. amqpconnection_setRpcTimeout_string.phpt 0000644 00000001126 15031735154 0014740 0 ustar 00 --TEST-- AMQPConnection setRpcTimeout string --SKIPIF-- <?php if (!extension_loaded("amqp")) print "skip AMQP extension is not loaded"; elseif (!getenv("PHP_AMQP_HOST")) print "skip PHP_AMQP_HOST environment variable is not set"; ?> --FILE-- <?php $timeout = ".34"; $cnn = new AMQPConnection(); $cnn->setHost(getenv('PHP_AMQP_HOST')); $cnn->setRpcTimeout($timeout); var_dump($cnn->getRpcTimeout()); var_dump($timeout); $timeout = "4.7e-2"; $cnn->setRpcTimeout($timeout); var_dump($cnn->getRpcTimeout()); var_dump($timeout); ?> --EXPECT-- float(0.34) string(3) ".34" float(0.047) string(6) "4.7e-2" amqpconnection_validation.phpt 0000644 00000012010 15031735154 0012667 0 ustar 00 --TEST-- AMQPConnection parameter validation --SKIPIF-- <?php if (!extension_loaded("amqp")) print "skip AMQP extension is not loaded"; ?> --FILE-- <?php $parameters = [ ['login', 'setLogin', 'getLogin', [str_repeat('X', 1025), 'user']], ['password', 'setPassword', 'getPassword', [str_repeat('X', 1025), 'pass']], ['host', 'setHost', 'getHost', [str_repeat('X', 513), 'host']], ['vhost', 'setVhost', 'getVhost', [str_repeat('X', 513), 'vhost']], ['port', 'setPort', 'getPort', [-1, 65536, 1234]], ['timeout', 'setTimeout', 'getTimeout', [-1], 10], ['read_timeout', 'setReadTimeout', 'getReadTimeout', [-1, 20]], ['write_timeout', 'setWriteTimeout', 'getWriteTimeout', [-1, 30]], ['connect_timeout', null, 'getConnectTimeout', [-1, 40]], ['rpc_timeout', 'setRpcTimeout', 'getRpcTimeout', [-1, 50]], ['frame_max', null, 'getMaxFrameSize', [-1, PHP_INT_MAX + 1, 128]], ['channel_max', null, 'getMaxChannels', [-1, 257, 128]], ['heartbeat', null, 'getHeartbeatInterval', [-1, PHP_INT_MAX + 1, 250, 0]], ]; foreach ($parameters as $args) { list($prop, $setter, $getter, $values) = $args; foreach ($values as $value) { try { $con1 = new AMQPConnection([$prop => $value]); echo $getter . " after constructor: "; echo $con1->{$getter}(); echo PHP_EOL; } catch (\Throwable $t) { echo get_class($t); echo ": "; echo $t->getMessage(); echo PHP_EOL; } if ($setter === null) { continue; } $con2 = new AMQPConnection(); try { $con2->{$setter}($value); echo $getter . " after setter: "; echo $con2->{$getter}(); echo PHP_EOL; } catch (\Throwable $t) { echo get_class($t); echo ": "; echo $t->getMessage(); echo PHP_EOL; } } } ?> ==DONE== --EXPECTF-- AMQPConnectionException: Parameter 'login' exceeds 1024 character limit. AMQPConnectionException: Parameter 'login' exceeds 1024 character limit. getLogin after constructor: user getLogin after setter: user AMQPConnectionException: Parameter 'password' exceeds 1024 character limit. AMQPConnectionException: Parameter 'password' exceeds 1024 character limit. getPassword after constructor: pass getPassword after setter: pass AMQPConnectionException: Parameter 'host' exceeds 512 character limit. AMQPConnectionException: Parameter 'host' exceeds 512 character limit. getHost after constructor: host getHost after setter: host AMQPConnectionException: Parameter 'vhost' exceeds 512 character limit. AMQPConnectionException: Parameter 'vhost' exceeds 512 characters limit. getVhost after constructor: vhost getVhost after setter: vhost AMQPConnectionException: Parameter 'port' must be a valid port number between 1 and 65535. AMQPConnectionException: Parameter 'port' must be a valid port number between 1 and 65535. AMQPConnectionException: Parameter 'port' must be a valid port number between 1 and 65535. AMQPConnectionException: Parameter 'port' must be a valid port number between 1 and 65535. getPort after constructor: 1234 getPort after setter: 1234 Deprecated: AMQPConnection::__construct(): Parameter 'timeout' is deprecated; use 'read_timeout' instead in %s on line %d AMQPConnectionException: Parameter 'timeout' must be greater than or equal to zero. Deprecated: AMQPConnection::setTimeout(): AMQPConnection::setTimeout($timeout) method is deprecated; use AMQPConnection::setReadTimeout($timeout) instead in %s on line %d AMQPConnectionException: Parameter 'timeout' must be greater than or equal to zero. AMQPConnectionException: Parameter 'read_timeout' must be greater than or equal to zero. AMQPConnectionException: Parameter 'readTimeout' must be greater than or equal to zero. getReadTimeout after constructor: 20 getReadTimeout after setter: 20 AMQPConnectionException: Parameter 'write_timeout' must be greater than or equal to zero. AMQPConnectionException: Parameter 'writeTimeout' must be greater than or equal to zero. getWriteTimeout after constructor: 30 getWriteTimeout after setter: 30 AMQPConnectionException: Parameter 'connect_timeout' must be greater than or equal to zero. getConnectTimeout after constructor: 40 AMQPConnectionException: Parameter 'rpc_timeout' must be greater than or equal to zero. AMQPConnectionException: Parameter 'rpcTimeout' must be greater than or equal to zero. getRpcTimeout after constructor: 50 getRpcTimeout after setter: 50 AMQPConnectionException: Parameter 'frame_max' is out of range. AMQPConnectionException: Parameter 'frame_max' is out of range. getMaxFrameSize after constructor: 128 AMQPConnectionException: Parameter 'channel_max' is out of range. AMQPConnectionException: Parameter 'channel_max' is out of range. getMaxChannels after constructor: 128 AMQPConnectionException: Parameter 'heartbeat' is out of range. AMQPConnectionException: Parameter 'heartbeat' is out of range. getHeartbeatInterval after constructor: 250 getHeartbeatInterval after constructor: 0 ==DONE== amqpconnection_setTimeout_float.phpt 0000644 00000001662 15031735154 0014077 0 ustar 00 --TEST-- AMQPConnection setTimeout float --SKIPIF-- <?php if (!extension_loaded("amqp")) print "skip AMQP extension is not loaded"; ?> --FILE-- <?php $cnn = new AMQPConnection(); $cnn->setTimeout(.34); var_dump($cnn->getTimeout()); $cnn->setTimeout(4.7e-2); var_dump($cnn->getTimeout());?> --EXPECTF-- %s: AMQPConnection::setTimeout(): AMQPConnection::setTimeout($timeout) method is deprecated; use AMQPConnection::setReadTimeout($timeout) instead in %s on line 3 %s: AMQPConnection::getTimeout(): AMQPConnection::getTimeout() method is deprecated; use AMQPConnection::getReadTimeout() instead in %s on line 4 float(0.34) %s: AMQPConnection::setTimeout(): AMQPConnection::setTimeout($timeout) method is deprecated; use AMQPConnection::setReadTimeout($timeout) instead in %s on line 5 %s: AMQPConnection::getTimeout(): AMQPConnection::getTimeout() method is deprecated; use AMQPConnection::getReadTimeout() instead in %s on line 6 float(0.047) amqpenvelope_construct.phpt 0000644 00000002445 15031735154 0012252 0 ustar 00 --TEST-- AMQPEnvelope construct --SKIPIF-- <?php if (!extension_loaded("amqp")) print "skip AMQP extension is not loaded"; ?> --FILE-- <?php var_dump(new AMQPEnvelope()); ?> --EXPECT-- object(AMQPEnvelope)#1 (20) { ["contentType":"AMQPBasicProperties":private]=> NULL ["contentEncoding":"AMQPBasicProperties":private]=> NULL ["headers":"AMQPBasicProperties":private]=> array(0) { } ["deliveryMode":"AMQPBasicProperties":private]=> int(1) ["priority":"AMQPBasicProperties":private]=> int(0) ["correlationId":"AMQPBasicProperties":private]=> NULL ["replyTo":"AMQPBasicProperties":private]=> NULL ["expiration":"AMQPBasicProperties":private]=> NULL ["messageId":"AMQPBasicProperties":private]=> NULL ["timestamp":"AMQPBasicProperties":private]=> NULL ["type":"AMQPBasicProperties":private]=> NULL ["userId":"AMQPBasicProperties":private]=> NULL ["appId":"AMQPBasicProperties":private]=> NULL ["clusterId":"AMQPBasicProperties":private]=> NULL ["body":"AMQPEnvelope":private]=> string(0) "" ["consumerTag":"AMQPEnvelope":private]=> NULL ["deliveryTag":"AMQPEnvelope":private]=> NULL ["isRedelivery":"AMQPEnvelope":private]=> bool(false) ["exchangeName":"AMQPEnvelope":private]=> NULL ["routingKey":"AMQPEnvelope":private]=> string(0) "" } amqpconnection_setPort_string.phpt 0000644 00000000711 15031735154 0013570 0 ustar 00 --TEST-- AMQPConnection setPort with string --SKIPIF-- <?php if (!extension_loaded("amqp")) print "skip AMQP extension is not loaded"; elseif (!getenv("PHP_AMQP_HOST")) print "skip PHP_AMQP_HOST environment variable is not set"; ?> --FILE-- <?php $cnn = new AMQPConnection(); $cnn->setHost(getenv('PHP_AMQP_HOST')); $port = '12345'; var_dump($cnn->setPort($port)); var_dump($cnn->getPort()); var_dump($port); ?> --EXPECT-- NULL int(12345) string(5) "12345" amqpconnection_setPassword.phpt 0000644 00000000713 15031735154 0013062 0 ustar 00 --TEST-- AMQPConnection setPassword --SKIPIF-- <?php if (!extension_loaded("amqp")) print "skip AMQP extension is not loaded"; elseif (!getenv("PHP_AMQP_HOST")) print "skip PHP_AMQP_HOST environment variable is not set"; ?> --FILE-- <?php $cnn = new AMQPConnection(); $cnn->setHost(getenv('PHP_AMQP_HOST')); var_dump($cnn->getPassword()); $cnn->setPassword('nonexistent'); var_dump($cnn->getPassword()); --EXPECTF-- string(5) "guest" string(11) "nonexistent" amqpexchange_declare_with_stalled_reference.phpt 0000644 00000001530 15031735154 0016345 0 ustar 00 --TEST-- AMQPExchange - declare with stalled reference --SKIPIF-- <?php if (!extension_loaded("amqp")) print "skip AMQP extension is not loaded"; ?> --FILE-- <?php class ConnectionMock extends AMQPConnection { public function __construct(array $credentials = array()) { } } class ChannelMock extends AMQPChannel { public function __construct(AMQPConnection $amqp_connection) { } } class ExchangeMock extends \AMQPExchange { public function __construct(AMQPChannel $amqp_channel) { } } $cnn = new ConnectionMock(); $ch = new ChannelMock($cnn); $e = new ExchangeMock($ch); try { $e->declareExchange(); } catch (\Exception $e) { echo get_class($e), "({$e->getCode()}): ", $e->getMessage(), PHP_EOL; } ?> --EXPECT-- AMQPChannelException(0): Could not declare exchange. Stale reference to the channel object. _test_helpers.php.inc 0000644 00000004277 15031735154 0010703 0 ustar 00 <?php function dump_methods($obj) { $methods = get_class_methods($obj); echo get_class($obj), PHP_EOL; foreach($methods as $m) { if ($m[0] == '_') { // ignore all _* methods continue; } echo ' ', $m, '():', PHP_EOL, ' ', ' '; var_dump($obj->$m()); } } function dump_message($msg) { if (!$msg) { var_dump($msg); return false; } echo get_class($msg), PHP_EOL; echo " getBody:", PHP_EOL, " "; var_dump($msg->getBody()); echo " getContentType:", PHP_EOL, " "; var_dump($msg->getContentType()); echo " getRoutingKey:", PHP_EOL, " "; var_dump($msg->getRoutingKey()); echo " getConsumerTag:", PHP_EOL, " "; var_dump($msg->getConsumerTag()); echo " getDeliveryTag:", PHP_EOL, " "; var_dump($msg->getDeliveryTag()); echo " getDeliveryMode:", PHP_EOL, " "; var_dump($msg->getDeliveryMode()); echo " getExchangeName:", PHP_EOL, " "; var_dump($msg->getExchangeName()); echo " isRedelivery:", PHP_EOL, " "; var_dump($msg->isRedelivery()); echo " getContentEncoding:", PHP_EOL, " "; var_dump($msg->getContentEncoding()); echo " getType:", PHP_EOL, " "; var_dump($msg->getType()); echo " getTimeStamp:", PHP_EOL, " "; var_dump($msg->getTimeStamp()); echo " getPriority:", PHP_EOL, " "; var_dump($msg->getPriority()); echo " getExpiration:", PHP_EOL, " "; var_dump($msg->getExpiration()); echo " getUserId:", PHP_EOL, " "; var_dump($msg->getUserId()); echo " getAppId:", PHP_EOL, " "; var_dump($msg->getAppId()); echo " getMessageId:", PHP_EOL, " "; var_dump($msg->getMessageId()); echo " getReplyTo:", PHP_EOL, " "; var_dump($msg->getReplyTo()); echo " getCorrelationId:", PHP_EOL, " "; var_dump($msg->getCorrelationId()); echo " getHeaders:", PHP_EOL, " "; var_dump($msg->getHeaders()); return false; } function consumeThings($message, $queue) { var_dump($message); return false; } amqpconnection_construct_ini_timeout_default.phpt 0000644 00000000735 15031735154 0016705 0 ustar 00 --TEST-- AMQPConnection constructor with amqp.timeout ini value set in code to it default value --SKIPIF-- <?php if (!extension_loaded("amqp")) print "skip AMQP extension is not loaded"; elseif (!getenv("PHP_AMQP_HOST")) print "skip PHP_AMQP_HOST environment variable is not set"; ?> --FILE-- <?php ini_set('amqp.timeout', ini_get('amqp.timeout')); $cnn = new AMQPConnection(); $cnn->setHost(getenv('PHP_AMQP_HOST')); var_dump($cnn->getReadTimeout()); ?> --EXPECTF-- float(0) amqpconnection_construct_ini_timeout_and_read_timeout.phpt 0000644 00000001347 15031735154 0020564 0 ustar 00 --TEST-- AMQPConnection constructor with both amqp.timeout and amqp.read_timeout ini values set --SKIPIF-- <?php if (!extension_loaded("amqp")) print "skip AMQP extension is not loaded"; elseif (!getenv("PHP_AMQP_HOST")) print "skip PHP_AMQP_HOST environment variable is not set"; ?> --INI-- amqp.timeout = 101.101 amqp.read_timeout = 202.202 --FILE-- <?php $cnn = new AMQPConnection(); $cnn->setHost(getenv('PHP_AMQP_HOST')); var_dump($cnn->getReadTimeout()); ?> --EXPECTF-- %s: AMQPConnection::__construct(): INI setting 'amqp.timeout' is deprecated; use 'amqp.read_timeout' instead in %s on line 2 Notice: AMQPConnection::__construct(): INI setting 'amqp.read_timeout' will be used instead of 'amqp.timeout' in %s on line 2 float(202.202) amqpconnection_setRpcTimeout_int.phpt 0000644 00000000672 15031735154 0014231 0 ustar 00 --TEST-- AMQPConnection setRpcTimeout int --SKIPIF-- <?php if (!extension_loaded("amqp")) print "skip AMQP extension is not loaded"; elseif (!getenv("PHP_AMQP_HOST")) print "skip PHP_AMQP_HOST environment variable is not set"; ?> --FILE-- <?php $timeout = 3; $cnn = new AMQPConnection(); $cnn->setHost(getenv('PHP_AMQP_HOST')); $cnn->setRpcTimeout($timeout); var_dump($cnn->getRpcTimeout()); var_dump($timeout); ?> --EXPECT-- float(3) int(3) amqpconnection_construct_ini_read_timeout.phpt 0000644 00000000673 15031735155 0016176 0 ustar 00 --TEST-- AMQPConnection constructor with amqp.read_timeout ini value set --SKIPIF-- <?php if (!extension_loaded("amqp")) print "skip AMQP extension is not loaded"; elseif (!getenv("PHP_AMQP_HOST")) print "skip PHP_AMQP_HOST environment variable is not set"; ?> --INI-- amqp.read_timeout=202.202 --FILE-- <?php $cnn = new AMQPConnection(); $cnn->setHost(getenv('PHP_AMQP_HOST')); var_dump($cnn->getReadTimeout()); ?> --EXPECTF-- float(202.202) bug_62354.phpt 0000644 00000001123 15031735155 0006763 0 ustar 00 --TEST-- Constructing AMQPQueue with AMQPConnection segfaults --SKIPIF-- <?php if (!extension_loaded("amqp")) print "skip AMQP extension is not loaded"; ?> --FILE-- <?php class Amqptest { public $conn = NULL; }; $o = new Amqptest(); $o->conn = new AMQPConnection(); $funcs = array( 'getHost', 'getLogin', 'getPassword', 'getPort', 'getVHost', 'isConnected' ); foreach ($funcs as $func) { printf("%s => %s\n", $func, var_export($o->conn->$func(), true)); }; ?> --EXPECT-- getHost => 'localhost' getLogin => 'guest' getPassword => 'guest' getPort => 5672 getVHost => '/' isConnected => false amqpconnection_construct_with_timeout_and_read_timeout.phpt 0000644 00000000764 15031735155 0020763 0 ustar 00 --TEST-- AMQPConnection constructor with both timeout and read_timeout parameters in credentials --SKIPIF-- <?php if (!extension_loaded("amqp")) print "skip AMQP extension is not loaded"; ?> --FILE-- <?php $credentials = array('timeout' => 101.101, 'read_timeout' => 202.202); $cnn = new AMQPConnection($credentials); var_dump($cnn->getReadTimeout()); ?> --EXPECTF-- Notice: AMQPConnection::__construct(): Parameter 'timeout' is deprecated, 'read_timeout' used instead in %s on line 3 float(202.202) amqpconnection_construct_with_timeout.phpt 0000644 00000000675 15031735155 0015401 0 ustar 00 --TEST-- AMQPConnection constructor with timeout parameter in credentials --SKIPIF-- <?php if (!extension_loaded("amqp")) print "skip AMQP extension is not loaded"; ?> --FILE-- <?php $credentials = array('timeout' => 101.101); $cnn = new AMQPConnection($credentials); var_dump($cnn->getReadTimeout()); ?> --EXPECTF-- %s: AMQPConnection::__construct(): Parameter 'timeout' is deprecated; use 'read_timeout' instead in %s on line 3 float(101.101) amqpbasicproperties.phpt 0000644 00000007137 15031735155 0011533 0 ustar 00 --TEST-- AMQPBasicProperties --SKIPIF-- <?php if (!extension_loaded("amqp")) print "skip AMQP extension is not loaded"; ?> --FILE-- <?php require '_test_helpers.php.inc'; $props = new AMQPBasicProperties(); var_dump($props); dump_methods($props); echo PHP_EOL; $props = new AMQPBasicProperties( "content_type", "content_encoding", array('test' => 'headers'), 42, 24, "correlation_id", "reply_to", "expiration", "message_id", 99999, "type", "user_id", "app_id", "cluster_id" ); var_dump($props); dump_methods($props); ?> --EXPECT-- object(AMQPBasicProperties)#1 (14) { ["contentType":"AMQPBasicProperties":private]=> NULL ["contentEncoding":"AMQPBasicProperties":private]=> NULL ["headers":"AMQPBasicProperties":private]=> array(0) { } ["deliveryMode":"AMQPBasicProperties":private]=> int(1) ["priority":"AMQPBasicProperties":private]=> int(0) ["correlationId":"AMQPBasicProperties":private]=> NULL ["replyTo":"AMQPBasicProperties":private]=> NULL ["expiration":"AMQPBasicProperties":private]=> NULL ["messageId":"AMQPBasicProperties":private]=> NULL ["timestamp":"AMQPBasicProperties":private]=> NULL ["type":"AMQPBasicProperties":private]=> NULL ["userId":"AMQPBasicProperties":private]=> NULL ["appId":"AMQPBasicProperties":private]=> NULL ["clusterId":"AMQPBasicProperties":private]=> NULL } AMQPBasicProperties getContentType(): NULL getContentEncoding(): NULL getHeaders(): array(0) { } getDeliveryMode(): int(1) getPriority(): int(0) getCorrelationId(): NULL getReplyTo(): NULL getExpiration(): NULL getMessageId(): NULL getTimestamp(): NULL getType(): NULL getUserId(): NULL getAppId(): NULL getClusterId(): NULL object(AMQPBasicProperties)#2 (14) { ["contentType":"AMQPBasicProperties":private]=> string(12) "content_type" ["contentEncoding":"AMQPBasicProperties":private]=> string(16) "content_encoding" ["headers":"AMQPBasicProperties":private]=> array(1) { ["test"]=> string(7) "headers" } ["deliveryMode":"AMQPBasicProperties":private]=> int(42) ["priority":"AMQPBasicProperties":private]=> int(24) ["correlationId":"AMQPBasicProperties":private]=> string(14) "correlation_id" ["replyTo":"AMQPBasicProperties":private]=> string(8) "reply_to" ["expiration":"AMQPBasicProperties":private]=> string(10) "expiration" ["messageId":"AMQPBasicProperties":private]=> string(10) "message_id" ["timestamp":"AMQPBasicProperties":private]=> int(99999) ["type":"AMQPBasicProperties":private]=> string(4) "type" ["userId":"AMQPBasicProperties":private]=> string(7) "user_id" ["appId":"AMQPBasicProperties":private]=> string(6) "app_id" ["clusterId":"AMQPBasicProperties":private]=> string(10) "cluster_id" } AMQPBasicProperties getContentType(): string(12) "content_type" getContentEncoding(): string(16) "content_encoding" getHeaders(): array(1) { ["test"]=> string(7) "headers" } getDeliveryMode(): int(42) getPriority(): int(24) getCorrelationId(): string(14) "correlation_id" getReplyTo(): string(8) "reply_to" getExpiration(): string(10) "expiration" getMessageId(): string(10) "message_id" getTimestamp(): int(99999) getType(): string(4) "type" getUserId(): string(7) "user_id" getAppId(): string(6) "app_id" getClusterId(): string(10) "cluster_id" amqpconnection_construct_ini_timeout.phpt 0000644 00000001056 15031735155 0015177 0 ustar 00 --TEST-- AMQPConnection constructor with amqp.timeout ini value set --SKIPIF-- <?php if (!extension_loaded("amqp")) print "skip AMQP extension is not loaded"; elseif (!getenv("PHP_AMQP_HOST")) print "skip PHP_AMQP_HOST environment variable is not set"; ?> --INI-- amqp.timeout=101.101 --FILE-- <?php $cnn = new AMQPConnection(); $cnn->setHost(getenv('PHP_AMQP_HOST')); var_dump($cnn->getReadTimeout()); ?> --EXPECTF-- %s: AMQPConnection::__construct(): INI setting 'amqp.timeout' is deprecated; use 'amqp.read_timeout' instead in %s on line 2 float(101.101) amqpconnection_setConnectionName.phpt 0000644 00000001064 15031735155 0014161 0 ustar 00 --TEST-- AMQPConnection setConnectionName --SKIPIF-- <?php if (!extension_loaded("amqp")) print "skip AMQP extension is not loaded"; elseif (!getenv("PHP_AMQP_HOST")) print "skip PHP_AMQP_HOST environment variable is not set"; ?> --FILE-- <?php $cnn = new AMQPConnection(); $cnn->setHost(getenv('PHP_AMQP_HOST')); var_dump($cnn->getConnectionName()); $cnn->setConnectionName('custom connection name'); var_dump($cnn->getConnectionName()); $cnn->setConnectionName(null); var_dump($cnn->getConnectionName()); --EXPECTF-- NULL string(22) "custom connection name" NULL amqpdecimal.phpt 0000644 00000002440 15031735155 0007723 0 ustar 00 --TEST-- AMQPDecimal --SKIPIF-- <?php if (!extension_loaded("amqp")) print "skip AMQP extension is not loaded"; ?> --FILE-- <?php $decimal = new AMQPDecimal(1, 2); var_dump($decimal->getExponent(), $decimal->getSignificand()); var_dump($decimal === $decimal->toAmqpValue()); var_dump($decimal instanceof AMQPValue); try { new AMQPDecimal(-1, 1); } catch (AMQPValueException $e) { echo $e->getMessage() . "\n"; } try { new AMQPDecimal(1, -1); } catch (AMQPValueException $e) { echo $e->getMessage() . "\n"; } try { new AMQPDecimal(AMQPDecimal::EXPONENT_MAX+1, 1); } catch (AMQPValueException $e) { echo $e->getMessage() . "\n"; } try { new AMQPDecimal(1, AMQPDecimal::SIGNIFICAND_MAX+1); } catch (AMQPValueException $e) { echo $e->getMessage() . "\n"; } var_dump((new ReflectionClass("AMQPDecimal"))->isFinal()); var_dump(AMQPDecimal::EXPONENT_MIN); var_dump(AMQPDecimal::EXPONENT_MAX); var_dump(AMQPDecimal::SIGNIFICAND_MIN); var_dump(AMQPDecimal::SIGNIFICAND_MAX); ?> ==END== --EXPECT-- int(1) int(2) bool(true) bool(true) Decimal exponent value must be unsigned. Decimal significand value must be unsigned. Decimal exponent value must be less than 255. Decimal significand value must be less than 4294967295. bool(true) int(0) int(255) int(0) int(4294967295) ==END== amqpconnection_setTimeout_deprecated.phpt 0000644 00000001045 15031735155 0015066 0 ustar 00 --TEST-- AMQPConnection setTimeout deprecated --SKIPIF-- <?php if (!extension_loaded("amqp")) print "skip AMQP extension is not loaded"; ?> --FILE-- <?php $cnn = new AMQPConnection(); $cnn->setTimeout(0); $cnn->getTimeout(); ?> --EXPECTF-- %s: AMQPConnection::setTimeout(): AMQPConnection::setTimeout($timeout) method is deprecated; use AMQPConnection::setReadTimeout($timeout) instead in %s on line 3 %s: AMQPConnection::getTimeout(): AMQPConnection::getTimeout() method is deprecated; use AMQPConnection::getReadTimeout() instead in %s on line 4 amqpconnection_setSaslMethod.phpt 0000644 00000001165 15031735155 0013326 0 ustar 00 --TEST-- AMQPConnection setSaslMethod int --SKIPIF-- <?php if (!extension_loaded("amqp")) print "skip AMQP extension is not loaded"; elseif (!getenv("PHP_AMQP_HOST")) print "skip PHP_AMQP_HOST environment variable is not set"; ?> --FILE-- <?php $cnn = new AMQPConnection(); $cnn->setHost(getenv('PHP_AMQP_HOST')); $cnn->setSaslMethod(0); var_dump($cnn->getSaslMethod()); $cnn->setSaslMethod(1); var_dump($cnn->getSaslMethod()); $cnn->setSaslMethod(AMQP_SASL_METHOD_PLAIN); var_dump($cnn->getSaslMethod()); $cnn->setSaslMethod(AMQP_SASL_METHOD_EXTERNAL); var_dump($cnn->getSaslMethod()); ?> --EXPECT-- int(0) int(1) int(0) int(1) amqpconnection_construct_with_rpc_timeout.phpt 0000644 00000000522 15031735155 0016234 0 ustar 00 --TEST-- AMQPConnection constructor with rpc_timeout parameter in credentials --SKIPIF-- <?php if (!extension_loaded("amqp")) print "skip AMQP extension is not loaded"; ?> --FILE-- <?php $credentials = array('rpc_timeout' => 303.303); $cnn = new AMQPConnection($credentials); var_dump($cnn->getRpcTimeout()); ?> --EXPECT-- float(303.303) amqpqueue_purge_basic.phpt 0000644 00000000216 15031735155 0012013 0 ustar 00 --TEST-- AMQPQueue --SKIPIF-- <?php if (!extension_loaded("amqp")) print "skip AMQP extension is not loaded"; ?> --FILE-- <?php ?> --EXPECT-- amqp_version.phpt 0000644 00000000745 15031735155 0010157 0 ustar 00 --TEST-- AMQP extension version constants --SKIPIF-- <?php if (!extension_loaded("amqp")) print "skip AMQP extension is not loaded"; ?> --FILE-- <?php var_dump(AMQP_EXTENSION_VERSION); var_dump(AMQP_EXTENSION_VERSION_MAJOR); var_dump(AMQP_EXTENSION_VERSION_MINOR); var_dump(AMQP_EXTENSION_VERSION_PATCH); var_dump(AMQP_EXTENSION_VERSION_EXTRA); var_dump(AMQP_EXTENSION_VERSION_ID); ?> ==DONE== --EXPECTF-- string(%d) "%d.%d.%s" int(%d) int(%d) int(%d) string(%d) "%S" int(%d) ==DONE== amqptimestamp.phpt 0000644 00000002115 15031735156 0010330 0 ustar 00 --TEST-- AMQPTimestamp --SKIPIF-- <?php if (!extension_loaded("amqp")) print "skip AMQP extension is not loaded"; ?> --FILE-- <?php $timestamp = new AMQPTimestamp(100000); var_dump($timestamp->getTimestamp(), (string) $timestamp); var_dump($timestamp === $timestamp->toAmqpValue()); var_dump($timestamp instanceof AMQPValue); $timestamp = new AMQPTimestamp(100000.1); var_dump($timestamp->getTimestamp(), (string) $timestamp); try { new AMQPTimestamp(AMQPTimestamp::MIN - 1); } catch (AMQPValueException $e) { echo $e->getMessage() . "\n"; } try { new AMQPTimestamp(INF); } catch (AMQPValueException $e) { echo $e->getMessage() . "\n"; } var_dump((new ReflectionClass("AMQPTimestamp"))->isFinal()); var_dump(number_format(AMQPTimestamp::MAX, 0, '.', '_')); var_dump(AMQPTimestamp::MIN); ?> ==END== --EXPECTF-- float(100000) string(6) "100000" bool(true) bool(true) float(100000) string(6) "100000" The timestamp parameter must be greater than 0. The timestamp parameter must be less than 18446744073709551616. bool(true) string(26) "18_446_744_073_709_551_616" float(0) ==END== extauth_01.phpt 0000644 00000007243 15031735246 0007437 0 ustar 00 --TEST-- Test External Authentication errors with oci_connect --EXTENSIONS-- oci8 --SKIPIF-- <?php if (substr(PHP_OS, 0, 3) == 'WIN') die("skip feature not available on Windows platforms"); die("skip random CI timeouts caused by Oracle Instant Client, see https://github.com/php/php-src/pull/9524#issuecomment-1244409815"); ?> --INI-- oci8.privileged_connect=1 --FILE-- <?php error_reporting(E_ALL ^ E_DEPRECATED); // Run Test echo "Test 1\n"; $c = oci_connect('/', 'notemtpy', 'anything', null, OCI_CRED_EXT); if (!$c) { $m = oci_error(); var_dump($m); } var_dump($c); echo "Test 2\n"; $c = oci_connect('notemtpy', 'notemtpy', 'anything', null, OCI_CRED_EXT); if (!$c) { $m = oci_error(); var_dump($m); } var_dump($c); echo "Test 3\n"; $c = oci_connect('notemtpy', '', 'anything', null, OCI_CRED_EXT); if (!$c) { $m = oci_error(); var_dump($m); } var_dump($c); echo "Test 4\n"; $c = oci_connect('a', 'b', 'c', null, OCI_SYSDBA+OCI_SYSOPER); if (!$c) { $m = oci_error(); var_dump($m); } var_dump($c); echo "Test 5\n"; $c = oci_connect('a', 'b', 'c', null, OCI_SYSDBA+OCI_SYSOPER+OCI_CRED_EXT); if (!$c) { $m = oci_error(); var_dump($m); } var_dump($c); echo "Test 6\n"; $c = oci_connect('', '', 'anything', null, OCI_CRED_EXT); if (!$c) { $m = oci_error(); var_dump($m); } var_dump($c); echo "Test 7\n"; $c = oci_connect('/', '', 'anything', null, OCI_CRED_EXT); if (!$c) { $m = oci_error(); var_dump($m); } var_dump($c); echo "Test 8\n"; $c = oci_connect('/', null, 'anything', null, OCI_CRED_EXT); if (!$c) { $m = oci_error(); var_dump($m); } var_dump($c); echo "Test 9\n"; $c = oci_connect('/', '', 'd', null, OCI_SYSDBA+OCI_CRED_EXT); if (!$c) { $m = oci_error(); var_dump($m); } var_dump($c); echo "Test 10\n"; $c = oci_connect('/', '', 'd', null, OCI_SYSOPER+OCI_CRED_EXT); if (!$c) { $m = oci_error(); var_dump($m); } var_dump($c); ?> --EXPECTF-- Test 1 Warning: oci_connect(): OCI_CRED_EXT can only be used with a username of "/" and a NULL password in %s on line %d bool(false) bool(false) Test 2 Warning: oci_connect(): OCI_CRED_EXT can only be used with a username of "/" and a NULL password in %s on line %d bool(false) bool(false) Test 3 Warning: oci_connect(): OCI_CRED_EXT can only be used with a username of "/" and a NULL password in %s on line %d bool(false) bool(false) Test 4 Warning: oci_connect(): OCI_SYSDBA and OCI_SYSOPER cannot be used together in %s on line %d bool(false) bool(false) Test 5 Warning: oci_connect(): OCI_SYSDBA and OCI_SYSOPER cannot be used together in %s on line %d bool(false) bool(false) Test 6 Warning: oci_connect(): OCI_CRED_EXT can only be used with a username of "/" and a NULL password in %s on line %d bool(false) bool(false) Test 7 Warning: oci_connect(): ORA-12154: %s in %s on line %d array(4) { ["code"]=> int(12154) ["message"]=> string(%d) "ORA-12154: %s" ["offset"]=> int(0) ["sqltext"]=> string(0) "" } bool(false) Test 8 Warning: oci_connect(): ORA-12154: %s in %s on line %d array(4) { ["code"]=> int(12154) ["message"]=> string(%d) "ORA-12154: %s" ["offset"]=> int(0) ["sqltext"]=> string(0) "" } bool(false) Test 9 Warning: oci_connect(): ORA-%d: %r(TNS:%s|Cannot connect to database\. Cannot find alias d)%r in %s on line %d array(4) { ["code"]=> int(%d) ["message"]=> string(%d) "ORA-%d: %s" ["offset"]=> int(0) ["sqltext"]=> string(0) "" } bool(false) Test 10 Warning: oci_connect(): ORA-%d: %r(TNS:%s|Cannot connect to database\. Cannot find alias d)%r in %s on line %d array(4) { ["code"]=> int(%d) ["message"]=> string(%d) "ORA-%d: %s" ["offset"]=> int(0) ["sqltext"]=> string(0) "" } bool(false) extauth_03.phpt 0000644 00000007270 15031735247 0007442 0 ustar 00 --TEST-- Test External Authentication errors with oci_pconnect --EXTENSIONS-- oci8 --SKIPIF-- <?php if (substr(PHP_OS, 0, 3) == 'WIN') die("skip feature not available on Windows platforms"); die("skip random CI timeouts caused by Oracle Instant Client, see https://github.com/php/php-src/pull/9524#issuecomment-1244409815"); ?> --INI-- oci8.privileged_connect=1 --FILE-- <?php error_reporting(E_ALL ^ E_DEPRECATED); // Run Test echo "Test 1\n"; $c = oci_pconnect('/', 'notemtpy', 'anything', null, OCI_CRED_EXT); if (!$c) { $m = oci_error(); var_dump($m); } var_dump($c); echo "Test 2\n"; $c = oci_pconnect('notemtpy', 'notemtpy', 'anything', null, OCI_CRED_EXT); if (!$c) { $m = oci_error(); var_dump($m); } var_dump($c); echo "Test 3\n"; $c = oci_pconnect('notemtpy', '', 'anything', null, OCI_CRED_EXT); if (!$c) { $m = oci_error(); var_dump($m); } var_dump($c); echo "Test 4\n"; $c = oci_pconnect('a', 'b', 'c', null, OCI_SYSDBA+OCI_SYSOPER); if (!$c) { $m = oci_error(); var_dump($m); } var_dump($c); echo "Test 5\n"; $c = oci_pconnect('a', 'b', 'c', null, OCI_SYSDBA+OCI_SYSOPER+OCI_CRED_EXT); if (!$c) { $m = oci_error(); var_dump($m); } var_dump($c); echo "Test 6\n"; $c = oci_pconnect('', '', 'anything', null, OCI_CRED_EXT); if (!$c) { $m = oci_error(); var_dump($m); } var_dump($c); echo "Test 7\n"; $c = oci_pconnect('/', '', 'anything', null, OCI_CRED_EXT); if (!$c) { $m = oci_error(); var_dump($m); } var_dump($c); echo "Test 8\n"; $c = oci_pconnect('/', null, 'anything', null, OCI_CRED_EXT); if (!$c) { $m = oci_error(); var_dump($m); } var_dump($c); echo "Test 9\n"; $c = oci_pconnect('/', '', 'd', null, OCI_SYSDBA+OCI_CRED_EXT); if (!$c) { $m = oci_error(); var_dump($m); } var_dump($c); echo "Test 10\n"; $c = oci_pconnect('/', '', 'd', null, OCI_SYSOPER+OCI_CRED_EXT); if (!$c) { $m = oci_error(); var_dump($m); } var_dump($c); ?> --EXPECTF-- Test 1 Warning: oci_pconnect(): OCI_CRED_EXT can only be used with a username of "/" and a NULL password in %s on line %d bool(false) bool(false) Test 2 Warning: oci_pconnect(): OCI_CRED_EXT can only be used with a username of "/" and a NULL password in %s on line %d bool(false) bool(false) Test 3 Warning: oci_pconnect(): OCI_CRED_EXT can only be used with a username of "/" and a NULL password in %s on line %d bool(false) bool(false) Test 4 Warning: oci_pconnect(): OCI_SYSDBA and OCI_SYSOPER cannot be used together in %s on line %d bool(false) bool(false) Test 5 Warning: oci_pconnect(): OCI_SYSDBA and OCI_SYSOPER cannot be used together in %s on line %d bool(false) bool(false) Test 6 Warning: oci_pconnect(): OCI_CRED_EXT can only be used with a username of "/" and a NULL password in %s on line %d bool(false) bool(false) Test 7 Warning: oci_pconnect(): ORA-12154: %s in %s on line %d array(4) { ["code"]=> int(12154) ["message"]=> string(%d) "ORA-12154: %s" ["offset"]=> int(0) ["sqltext"]=> string(0) "" } bool(false) Test 8 Warning: oci_pconnect(): ORA-12154: %s in %s on line %d array(4) { ["code"]=> int(12154) ["message"]=> string(%d) "ORA-12154: %s" ["offset"]=> int(0) ["sqltext"]=> string(0) "" } bool(false) Test 9 Warning: oci_pconnect(): ORA-%d: %r(TNS:%s|Cannot connect to database\. Cannot find alias d)%r in %s on line %d array(4) { ["code"]=> int(%d) ["message"]=> string(%d) "ORA-%d: %s" ["offset"]=> int(0) ["sqltext"]=> string(0) "" } bool(false) Test 10 Warning: oci_pconnect(): ORA-%d: %r(TNS:%s|Cannot connect to database\. Cannot find alias d)%r in %s on line %d array(4) { ["code"]=> int(%d) ["message"]=> string(%d) "ORA-%d: %s" ["offset"]=> int(0) ["sqltext"]=> string(0) "" } bool(false) drcp_connection_class.phpt 0000644 00000001315 15031735247 0012004 0 ustar 00 --TEST-- DRCP: oci8.connection_class with ini_get() and ini_set() --EXTENSIONS-- oci8 --SKIPIF-- <?php preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); if (!(isset($matches[0]) && $matches[0] >= 11)) { die("skip works only with Oracle 11g or greater version of Oracle client libraries"); } ?> --INI-- oci8.connection_class=test --FILE-- <?php echo "Setting a new connection class now\n"; ini_set('oci8.connection_class',"New cc"); // Get the New connection class name. Should return New CC $new_cc = ini_get('oci8.connection_class'); echo "The New oci8.connection_class is $new_cc\n"; echo "Done\n"; ?> --EXPECT-- Setting a new connection class now The New oci8.connection_class is New cc Done extauth_02.phpt 0000644 00000007361 15031735247 0007442 0 ustar 00 --TEST-- Test External Authentication errors with oci_new_connect --EXTENSIONS-- oci8 --SKIPIF-- <?php if (substr(PHP_OS, 0, 3) == 'WIN') die("skip feature not available on Windows platforms"); die("skip random CI timeouts caused by Oracle Instant Client, see https://github.com/php/php-src/pull/9524#issuecomment-1244409815"); ?> --INI-- oci8.privileged_connect=1 --FILE-- <?php error_reporting(E_ALL ^ E_DEPRECATED); // Run Test echo "Test 1\n"; $c = oci_new_connect('/', 'notemtpy', 'anything', null, OCI_CRED_EXT); if (!$c) { $m = oci_error(); var_dump($m); } var_dump($c); echo "Test 2\n"; $c = oci_new_connect('notemtpy', 'notemtpy', 'anything', null, OCI_CRED_EXT); if (!$c) { $m = oci_error(); var_dump($m); } var_dump($c); echo "Test 3\n"; $c = oci_new_connect('notemtpy', '', 'anything', null, OCI_CRED_EXT); if (!$c) { $m = oci_error(); var_dump($m); } var_dump($c); echo "Test 4\n"; $c = oci_new_connect('a', 'b', 'c', null, OCI_SYSDBA+OCI_SYSOPER); if (!$c) { $m = oci_error(); var_dump($m); } var_dump($c); echo "Test 5\n"; $c = oci_new_connect('a', 'b', 'c', null, OCI_SYSDBA+OCI_SYSOPER+OCI_CRED_EXT); if (!$c) { $m = oci_error(); var_dump($m); } var_dump($c); echo "Test 6\n"; $c = oci_new_connect('', '', 'anything', null, OCI_CRED_EXT); if (!$c) { $m = oci_error(); var_dump($m); } var_dump($c); echo "Test 7\n"; $c = oci_new_connect('/', '', 'anything', null, OCI_CRED_EXT); if (!$c) { $m = oci_error(); var_dump($m); } var_dump($c); echo "Test 8\n"; $c = oci_new_connect('/', null, 'anything', null, OCI_CRED_EXT); if (!$c) { $m = oci_error(); var_dump($m); } var_dump($c); echo "Test 9\n"; $c = oci_new_connect('/', '', 'd', null, OCI_SYSDBA+OCI_CRED_EXT); if (!$c) { $m = oci_error(); var_dump($m); } var_dump($c); echo "Test 10\n"; $c = oci_new_connect('/', '', 'd', null, OCI_SYSOPER+OCI_CRED_EXT); if (!$c) { $m = oci_error(); var_dump($m); } var_dump($c); ?> --EXPECTF-- Test 1 Warning: oci_new_connect(): OCI_CRED_EXT can only be used with a username of "/" and a NULL password in %s on line %d bool(false) bool(false) Test 2 Warning: oci_new_connect(): OCI_CRED_EXT can only be used with a username of "/" and a NULL password in %s on line %d bool(false) bool(false) Test 3 Warning: oci_new_connect(): OCI_CRED_EXT can only be used with a username of "/" and a NULL password in %s on line %d bool(false) bool(false) Test 4 Warning: oci_new_connect(): OCI_SYSDBA and OCI_SYSOPER cannot be used together in %s on line %d bool(false) bool(false) Test 5 Warning: oci_new_connect(): OCI_SYSDBA and OCI_SYSOPER cannot be used together in %s on line %d bool(false) bool(false) Test 6 Warning: oci_new_connect(): OCI_CRED_EXT can only be used with a username of "/" and a NULL password in %s on line %d bool(false) bool(false) Test 7 Warning: oci_new_connect(): ORA-12154: %s in %s on line %d array(4) { ["code"]=> int(12154) ["message"]=> string(%d) "ORA-12154: %s" ["offset"]=> int(0) ["sqltext"]=> string(0) "" } bool(false) Test 8 Warning: oci_new_connect(): ORA-12154: %s in %s on line %d array(4) { ["code"]=> int(12154) ["message"]=> string(%d) "ORA-12154: %s" ["offset"]=> int(0) ["sqltext"]=> string(0) "" } bool(false) Test 9 Warning: oci_new_connect(): ORA-%d: %r(TNS:%s|Cannot connect to database\. Cannot find alias d)%r %s on line %d array(4) { ["code"]=> int(%d) ["message"]=> string(%d) "ORA-%d: %s" ["offset"]=> int(0) ["sqltext"]=> string(0) "" } bool(false) Test 10 Warning: oci_new_connect(): ORA-%d: %r(TNS:%s|Cannot connect to database\. Cannot find alias d)%r %s on line %d array(4) { ["code"]=> int(%d) ["message"]=> string(%d) "ORA-%d: %s" ["offset"]=> int(0) ["sqltext"]=> string(0) "" } bool(false) clientversion.phpt 0000644 00000000202 15031735247 0010326 0 ustar 00 --TEST-- oci_client_version() --EXTENSIONS-- oci8 --FILE-- <?php echo oci_client_version(), "\n"; ?> --EXPECTF-- %d.%d.%d.%d.%d ini_1.phpt 0000644 00000006242 15031735247 0006453 0 ustar 00 --TEST-- Test OCI8 php.ini settings --EXTENSIONS-- oci8 --SKIPIF-- <?php preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); if (!(isset($matches[0]) && $matches[0] >= 11)) { die("skip works only with Oracle 11g or greater version of Oracle client libraries"); } ?> --INI-- oci8.privileged_connect = On oci8.max_persistent = 111 oci8.persistent_timeout = 222 oci8.ping_interval = 333 oci8.connection_class = MyCC oci8.events = On oci8.statement_cache_size = 444 oci8.default_prefetch = 555 oci8.old_oci_close_semantics = On --FILE-- <?php echo "Test 1 - check initialization\n"; echo 'oci8.privileged_connect = ' . ini_get('oci8.privileged_connect') . "\n"; echo 'oci8.max_persistent = ' . ini_get('oci8.max_persistent') . "\n"; echo 'oci8.persistent_timeout = ' . ini_get('oci8.persistent_timeout') . "\n"; echo 'oci8.ping_interval = ' . ini_get('oci8.ping_interval') . "\n"; echo 'oci8.connection_class = ' . ini_get('oci8.connection_class') . "\n"; echo 'oci8.events = ' . ini_get('oci8.events') . "\n"; echo 'oci8.statement_cache_size = ' . ini_get('oci8.statement_cache_size') . "\n"; echo 'oci8.default_prefetch = ' . ini_get('oci8.default_prefetch') . "\n"; echo 'oci8.old_oci_close_semantics = ' . ini_get('oci8.old_oci_close_semantics') . "\n"; echo "Test 2 - check what can be changed at runtime\n"; var_dump(ini_set('oci8.privileged_connect', 'Off')); echo 'oci8.privileged_connect = ' . ini_get('oci8.privileged_connect') . "\n"; var_dump(ini_set('oci8.max_persistent', '999')); echo 'oci8.max_persistent = ' . ini_get('oci8.max_persistent') . "\n"; var_dump(ini_set('oci8.persistent_timeout', '888')); echo 'oci8.persistent_timeout = ' . ini_get('oci8.persistent_timeout') . "\n"; var_dump(ini_set('oci8.ping_interval', '777')); echo 'oci8.ping_interval = ' . ini_get('oci8.ping_interval') . "\n"; var_dump(ini_set('oci8.connection_class', 'OtherCC')); echo 'oci8.connection_class = ' . ini_get('oci8.connection_class') . "\n"; var_dump(ini_set('oci8.events', 'Off')); echo 'oci8.events = ' . ini_get('oci8.events') . "\n"; var_dump(ini_set('oci8.statement_cache_size', '666')); echo 'oci8.statement_cache_size = ' . ini_get('oci8.statement_cache_size') . "\n"; var_dump(ini_set('oci8.default_prefetch', '111')); echo 'oci8.default_prefetch = ' . ini_get('oci8.default_prefetch') . "\n"; var_dump(ini_set('oci8.old_oci_close_semantics', 'Off')); echo 'oci8.old_oci_close_semantics = ' . ini_get('oci8.old_oci_close_semantics') . "\n"; ?> --EXPECTF-- Deprecated: Directive oci8.old_oci_close_semantics is deprecated%s Test 1 - check initialization oci8.privileged_connect = 1 oci8.max_persistent = 111 oci8.persistent_timeout = 222 oci8.ping_interval = 333 oci8.connection_class = MyCC oci8.events = 1 oci8.statement_cache_size = 444 oci8.default_prefetch = 555 oci8.old_oci_close_semantics = 1 Test 2 - check what can be changed at runtime bool(false) oci8.privileged_connect = 1 bool(false) oci8.max_persistent = 111 bool(false) oci8.persistent_timeout = 222 bool(false) oci8.ping_interval = 333 string(4) "MyCC" oci8.connection_class = OtherCC bool(false) oci8.events = 1 bool(false) oci8.statement_cache_size = 444 bool(false) oci8.default_prefetch = 555 bool(false) oci8.old_oci_close_semantics = 1 error1.phpt 0000644 00000000766 15031735247 0006673 0 ustar 00 --TEST-- oci_error() when oci_connect() fails --EXTENSIONS-- oci8 --FILE-- <?php putenv('ORA_SUPPRESS_ERROR_URL=TRUE'); // suppress Oracle Database 23ai error message URLs var_dump(oci_connect("some", "some", "some")); var_dump(oci_error()); echo "Done\n"; ?> --EXPECTF-- Warning: oci_connect(): ORA-12154: %s in %s on line %d bool(false) array(4) { ["code"]=> int(12154) ["message"]=> string(%d) "ORA-12154: %s" ["offset"]=> int(0) ["sqltext"]=> string(0) "" } Done minfo.phpt 0000644 00000000405 15031735247 0006557 0 ustar 00 --TEST-- Code coverage for PHP_MINFO_FUNCTION(oci) --EXTENSIONS-- oci8 --FILE-- <?php ob_start(); phpinfo(INFO_MODULES); $v = ob_get_clean(); $r = preg_match('/OCI8 Support .* enabled/', $v); if ($r !== 1) var_dump($r); echo "Done\n"; ?> --EXPECT-- Done lob_aliases.phpt 0000644 00000002357 15031735247 0007734 0 ustar 00 --TEST-- LOB method aliases --EXTENSIONS-- oci8 --FILE-- <?php // Function existence echo "Test 1\n"; var_dump(function_exists('oci_lob_load')); var_dump(function_exists('oci_lob_tell')); var_dump(function_exists('oci_lob_truncate')); var_dump(function_exists('oci_lob_erase')); var_dump(function_exists('oci_lob_flush')); var_dump(function_exists('ocisetbufferinglob')); var_dump(function_exists('ocigetbufferinglob')); var_dump(function_exists('oci_lob_rewind')); var_dump(function_exists('oci_lob_read')); var_dump(function_exists('oci_lob_eof')); var_dump(function_exists('oci_lob_seek')); var_dump(function_exists('oci_lob_write')); var_dump(function_exists('oci_lob_append')); var_dump(function_exists('oci_lob_size')); var_dump(function_exists('oci_lob_export')); var_dump(function_exists('oci_lob_export')); var_dump(function_exists('oci_lob_import')); var_dump(function_exists('oci_lob_save')); var_dump(function_exists('oci_lob_import')); var_dump(function_exists('oci_free_descriptor')); echo "Done\n"; ?> --EXPECT-- Test 1 bool(true) bool(true) bool(true) bool(true) bool(true) bool(true) bool(true) bool(true) bool(true) bool(true) bool(true) bool(true) bool(true) bool(true) bool(true) bool(true) bool(true) bool(true) bool(true) bool(true) Done
Copyright ©2021 || Defacer Indonesia