Source

pecl-event / tests / 07-listener-error.phpt

Ruslan Osmanov 1c015d2 

Ruslan Osmanov 3ca05da 

Anatol Belski 2178033 

Ruslan Osmanov 3ca05da 
Ruslan Osmanov 1c015d2 



Ruslan Osmanov 26cd25e 












Ruslan Osmanov 1c015d2 


Ruslan Osmanov 26cd25e 


--TEST--
Check for EventListener error behaviour 
--SKIPIF--
<?php
if (!class_exists("EventListener")) die("skip Event extra functions are disabled");
if (substr(PHP_OS, 0, 3) == "WIN") die('skip Not for Windows');
?>
--FILE--
<?php
$base = new EventBase();

$sock_paths = array (
	"unix:/tmp/".mt_rand().".sock" => TRUE,
	"UNIX:/tmp/".mt_rand().".sock" => TRUE,
	":/tmp/".mt_rand().".sock"     => FALSE,
	"/tmp/".mt_rand().".sock"      => FALSE,
);

foreach ($sock_paths as $path => $expect) {
	$listener = @new EventListener($base, function() {}, NULL, 0, -1, $path);
	if (file_exists($path)) unlink($path);

	var_dump(is_null($listener) != $expect);
}

?>
--EXPECT--
bool(true)
bool(true)
bool(true)
bool(true)