This repository has been archived on 2018-04-01. You can view files and clone it, but cannot push or open issues or pull requests.
php-asio/tests/01-service.phpt

19 lines
412 B
PHP

--TEST--
Test for `Service`.
--FILE--
<?php
$service = new Asio\Service();
$service->dispatch(function () use ($service) {
echo 'Service::dispatch()', PHP_EOL;
$service->post(function ($arg) use ($service) {
echo "Service::post($arg)";
}, 'foo');
});
$service->run($ec);
if ($ec)
echo 'Error on Service::run(). ', posix_strerror($ec);
?>
--EXPECT--
Service::dispatch()
Service::post(foo)