%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /proc/985914/root/data/old/usr/share/tests/pear/memcached/tests/
Upload File :
Create Path :
Current File : //proc/985914/root/data/old/usr/share/tests/pear/memcached/tests/callback_exception.phpt

--TEST--
make sure that callback exception behaves correctly
--SKIPIF--
<?php include "skipif.inc";?>
--FILE--
<?php

function throw_something(Memcached $object, $p_id = null)
{
    throw new Exception("from cb");
}

function empty_cb(Memcached $object, $p_id = null)
{
    echo "empty_cb called\n";
}

try {
    $m = new Memcached('test_id', 'throw_something');
    echo "fail\n";
} catch (Exception $e) {
    echo "success\n";
}

try {
    $m = new Memcached('test_id', 'throw_something');
    echo "fail\n";
} catch (Exception $e) {
    echo "success\n";
}

try {
    $m = new Memcached('test_id', 'empty_cb');
    $m = new Memcached('test_id', 'empty_cb');
} catch (Exception $e) {
    echo "fail\n";
}

try {
    $m = new Memcached(null, 'throw_something');
    echo "fail\n";
} catch (Exception $e) {
    echo "success\n";
}

echo "OK\n";

?>
--EXPECT--
success
success
empty_cb called
success
OK

Zerion Mini Shell 1.0