diff --git a/README.markdown b/README.markdown index 4321303..3177698 100644 --- a/README.markdown +++ b/README.markdown @@ -1,7 +1,8 @@ Description ----------- -[![Build Status](https://api.travis-ci.org/Timandes/php-zookeeper.svg?branch=master)](https://travis-ci.org/Timandes/php-zookeeper) +[![Build Status](https://img.shields.io/travis/fabiorphp/php-zookeeper/master.svg?style=flat-square)](https://travis-ci.org/fabiorphp/php-zookeeper) +[![Coveralls](https://img.shields.io/coveralls/fabiorphp/php-zookeeper.svg?style=flat-square)](https://coveralls.io/r/fabiorphp/php-zookeeper?branch=master) This extension uses libzookeeper library to provide API for communicating with diff --git a/tests/add_auth.phpt b/tests/add_auth.phpt new file mode 100644 index 0000000..a5c981b --- /dev/null +++ b/tests/add_auth.phpt @@ -0,0 +1,13 @@ +--TEST-- +Should add auth +--SKIPIF-- +addAuth('test', 'test'); +--EXPECT-- +1 diff --git a/tests/check_if_exists_without_connect.phpt b/tests/check_if_exists_without_connect.phpt new file mode 100644 index 0000000..98733dc --- /dev/null +++ b/tests/check_if_exists_without_connect.phpt @@ -0,0 +1,13 @@ +--TEST-- +Should check if node exists without connect +--SKIPIF-- +exists('/test1'); +--EXPECTF-- +Warning: Zookeeper::exists(): Zookeeper connect was not called in %s on line %d diff --git a/tests/create_node_without_connect.phpt b/tests/create_node_without_connect.phpt new file mode 100644 index 0000000..c4bee56 --- /dev/null +++ b/tests/create_node_without_connect.phpt @@ -0,0 +1,20 @@ +--TEST-- +Should create node without connect +--SKIPIF-- +create('/test6', null, array( + array( + 'perms' => Zookeeper::PERM_ALL, + 'scheme' => 'world', + 'id' => 'anyone' + ) +)); +--EXPECTF-- +Warning: Zookeeper::create(): Zookeeper connect was not called in %s on line %d diff --git a/tests/extension_info.phpt b/tests/extension_info.phpt new file mode 100644 index 0000000..32c8a80 --- /dev/null +++ b/tests/extension_info.phpt @@ -0,0 +1,25 @@ +--TEST-- +Show extension info +--SKIPIF-- +\t]*)(.*)/', $data, $match)) { + echo trim(end($match)); +} + +--EXPECTF-- +1enabled diff --git a/tests/remove_node_without_connect.phpt b/tests/remove_node_without_connect.phpt new file mode 100644 index 0000000..be2503b --- /dev/null +++ b/tests/remove_node_without_connect.phpt @@ -0,0 +1,13 @@ +--TEST-- +Should delete node without connect +--SKIPIF-- +delete('/test5'); +--EXPECTF-- +Warning: Zookeeper::delete(): Zookeeper connect was not called in %s on line %d diff --git a/tests/retrieve_acl.phpt b/tests/retrieve_acl.phpt new file mode 100644 index 0000000..6d693d7 --- /dev/null +++ b/tests/retrieve_acl.phpt @@ -0,0 +1,16 @@ +--TEST-- +Should retrieve acl +--SKIPIF-- +getAcl('/zookeeper'); +echo $acl[1][0]['perms'] === Zookeeper::PERM_ALL; +echo $acl[1][0]['scheme']; +echo $acl[1][0]['id']; +--EXPECTF-- +1worldanyone diff --git a/tests/retrieve_acl_error_with_invalid_node.phpt b/tests/retrieve_acl_error_with_invalid_node.phpt new file mode 100644 index 0000000..537ac8e --- /dev/null +++ b/tests/retrieve_acl_error_with_invalid_node.phpt @@ -0,0 +1,13 @@ +--TEST-- +Should retrieve error when set invalid node +--SKIPIF-- +getAcl('/zoo'); +--EXPECTF-- +Warning: Zookeeper::getAcl(): error: no node in %s on line %d diff --git a/tests/retrieve_acl_without_connect.phpt b/tests/retrieve_acl_without_connect.phpt new file mode 100644 index 0000000..1c332df --- /dev/null +++ b/tests/retrieve_acl_without_connect.phpt @@ -0,0 +1,13 @@ +--TEST-- +Should retrieve acl without connect +--SKIPIF-- +getAcl('/zookeeper'); +--EXPECTF-- +Warning: Zookeeper::getAcl(): Zookeeper connect was not called in %s on line %d diff --git a/tests/retrieve_bool_is_recoverable.phpt b/tests/retrieve_bool_is_recoverable.phpt new file mode 100644 index 0000000..49bc0cf --- /dev/null +++ b/tests/retrieve_bool_is_recoverable.phpt @@ -0,0 +1,13 @@ +--TEST-- +Should retrieve bool if is recoverable +--SKIPIF-- +isRecoverable(); +--EXPECT-- +1 diff --git a/tests/retrieve_bool_is_recoverable_without_conect.phpt b/tests/retrieve_bool_is_recoverable_without_conect.phpt new file mode 100644 index 0000000..6bff2c7 --- /dev/null +++ b/tests/retrieve_bool_is_recoverable_without_conect.phpt @@ -0,0 +1,13 @@ +--TEST-- +Should retrieve bool if is recoverable without connect +--SKIPIF-- +isRecoverable(); +--EXPECTF-- +Warning: Zookeeper::isRecoverable(): Zookeeper connect was not called in %s on line %d diff --git a/tests/retrieve_children.phpt b/tests/retrieve_children.phpt new file mode 100644 index 0000000..11dac95 --- /dev/null +++ b/tests/retrieve_children.phpt @@ -0,0 +1,13 @@ +--TEST-- +Should retrieve children +--SKIPIF-- +getChildren('/zookeeper')); +--EXPECTF-- +%d diff --git a/tests/retrieve_children_with_invalid_node.phpt b/tests/retrieve_children_with_invalid_node.phpt new file mode 100644 index 0000000..2b7fe33 --- /dev/null +++ b/tests/retrieve_children_with_invalid_node.phpt @@ -0,0 +1,13 @@ +--TEST-- +Should retrieve children with invalid node +--SKIPIF-- +getChildren('/zoo'); +--EXPECTF-- +Warning: Zookeeper::getChildren(): error: no node in %s on line %d diff --git a/tests/retrieve_children_with_watcher_callback.phpt b/tests/retrieve_children_with_watcher_callback.phpt new file mode 100644 index 0000000..966c12d --- /dev/null +++ b/tests/retrieve_children_with_watcher_callback.phpt @@ -0,0 +1,13 @@ +--TEST-- +Should retrieve children with watcher callback +--SKIPIF-- +getChildren('/zookeeper', function(){})); +--EXPECTF-- +%d diff --git a/tests/retrieve_children_without_connect.phpt b/tests/retrieve_children_without_connect.phpt new file mode 100644 index 0000000..650890b --- /dev/null +++ b/tests/retrieve_children_without_connect.phpt @@ -0,0 +1,13 @@ +--TEST-- +Should retrieve children without connect +--SKIPIF-- +getChildren('/zookeeper'); +--EXPECTF-- +Warning: Zookeeper::getChildren(): Zookeeper connect was not called in %s on line %d diff --git a/tests/retrieve_client_id_without_connect.phpt b/tests/retrieve_client_id_without_connect.phpt new file mode 100644 index 0000000..590dba4 --- /dev/null +++ b/tests/retrieve_client_id_without_connect.phpt @@ -0,0 +1,13 @@ +--TEST-- +Should get client id without_connect +--SKIPIF-- +getClientId(); +--EXPECTF-- +Warning: Zookeeper::getClientId(): Zookeeper connect was not called in %s on line %d diff --git a/tests/retrieve_error_recv_timeout_with_invalid_param.phpt b/tests/retrieve_error_recv_timeout_with_invalid_param.phpt new file mode 100644 index 0000000..c2cbb5f --- /dev/null +++ b/tests/retrieve_error_recv_timeout_with_invalid_param.phpt @@ -0,0 +1,13 @@ +--TEST-- +Should retrieve error recv timeout with invalid parameter +--SKIPIF-- +getRecvTimeout(array()); +--EXPECTF-- +Warning: Zookeeper::getRecvTimeout() expects exactly %d parameters, %d given in %s on line %d diff --git a/tests/retrieve_error_when_get_node_with_invalid_param.phpt b/tests/retrieve_error_when_get_node_with_invalid_param.phpt new file mode 100644 index 0000000..9acb376 --- /dev/null +++ b/tests/retrieve_error_when_get_node_with_invalid_param.phpt @@ -0,0 +1,13 @@ +--TEST-- +Should get Zookeeper node with invalid parameter +--SKIPIF-- +get(array()); +--EXPECTF-- +Warning: Zookeeper::get() expects parameter %d to be string, array given in %s on line %d diff --git a/tests/retrieve_error_when_getchildren_with_invalid_param.phpt b/tests/retrieve_error_when_getchildren_with_invalid_param.phpt new file mode 100644 index 0000000..8b1e034 --- /dev/null +++ b/tests/retrieve_error_when_getchildren_with_invalid_param.phpt @@ -0,0 +1,13 @@ +--TEST-- +Should retrieve error when get children with invalid param +--SKIPIF-- +getChildren(array()); +--EXPECTF-- +Warning: Zookeeper::getChildren() expects parameter %d to be string, array given in %s on line %d diff --git a/tests/retrieve_error_with_invalid_acl_param.phpt b/tests/retrieve_error_with_invalid_acl_param.phpt new file mode 100644 index 0000000..45a2707 --- /dev/null +++ b/tests/retrieve_error_with_invalid_acl_param.phpt @@ -0,0 +1,13 @@ +--TEST-- +Should retrieve error when set invalid acl parameter +--SKIPIF-- +getAcl(array()); +--EXPECTF-- +Warning: Zookeeper::getAcl() expects parameter %d to be string, array given in %s on line %d diff --git a/tests/retrieve_node.phpt b/tests/retrieve_node.phpt new file mode 100644 index 0000000..d397c1a --- /dev/null +++ b/tests/retrieve_node.phpt @@ -0,0 +1,23 @@ +--TEST-- +Should get Zookeeper node +--SKIPIF-- +create('/test1', 'something', array( + array( + 'perms' => Zookeeper::PERM_ALL, + 'scheme' => 'world', + 'id' => 'anyone' + ) +)); + +echo $client->get('/test1'); + +$client->delete('/test1'); +--EXPECT-- +something diff --git a/tests/retrieve_node_with_maxsize_param.phpt b/tests/retrieve_node_with_maxsize_param.phpt new file mode 100644 index 0000000..053adc7 --- /dev/null +++ b/tests/retrieve_node_with_maxsize_param.phpt @@ -0,0 +1,24 @@ +--TEST-- +Should get node with max size +--SKIPIF-- +create('/test1', 'something', array( + array( + 'perms' => Zookeeper::PERM_ALL, + 'scheme' => 'world', + 'id' => 'anyone' + ) +)); + +$stat = ''; +echo $client->get('/test1', null, $stat, 10); + +$client->delete('/test1'); +--EXPECT-- +something diff --git a/tests/retrieve_node_with_watcher_callback.phpt b/tests/retrieve_node_with_watcher_callback.phpt new file mode 100644 index 0000000..4d3c401 --- /dev/null +++ b/tests/retrieve_node_with_watcher_callback.phpt @@ -0,0 +1,21 @@ +--TEST-- +Should get Zookeeper node with watcher callback +--SKIPIF-- +get('/zookeeper', array($this, 'watcher')); + } +} + +$test = new Test('127.0.0.1:2181'); +echo gettype($test->get('/zookeeper', array($test, 'watcher'))); +--EXPECT-- +NULL diff --git a/tests/retrieve_node_without_connect.phpt b/tests/retrieve_node_without_connect.phpt new file mode 100644 index 0000000..7f87d51 --- /dev/null +++ b/tests/retrieve_node_without_connect.phpt @@ -0,0 +1,13 @@ +--TEST-- +Should get node without connect +--SKIPIF-- +get('/test1'); +--EXPECTF-- +Warning: Zookeeper::get(): Zookeeper connect was not called in %s on line %d diff --git a/tests/retrieve_null_when_get_empty_node.phpt b/tests/retrieve_null_when_get_empty_node.phpt new file mode 100644 index 0000000..462edeb --- /dev/null +++ b/tests/retrieve_null_when_get_empty_node.phpt @@ -0,0 +1,23 @@ +--TEST-- +Should retrieve null when get empty node +--SKIPIF-- +create('/test1', '', array( + array( + 'perms' => Zookeeper::PERM_ALL, + 'scheme' => 'world', + 'id' => 'anyone' + ) +)); + +echo gettype($client->get('/test1')); + +$client->delete('/test1'); +--EXPECT-- +NULL diff --git a/tests/retrieve_recv_timeout.phpt b/tests/retrieve_recv_timeout.phpt new file mode 100644 index 0000000..f141098 --- /dev/null +++ b/tests/retrieve_recv_timeout.phpt @@ -0,0 +1,13 @@ +--TEST-- +Should retrieve recv timeout +--SKIPIF-- +getRecvTimeout(); +--EXPECTF-- +%d diff --git a/tests/retrieve_recv_timeout_without_connect.phpt b/tests/retrieve_recv_timeout_without_connect.phpt new file mode 100644 index 0000000..422cafa --- /dev/null +++ b/tests/retrieve_recv_timeout_without_connect.phpt @@ -0,0 +1,13 @@ +--TEST-- +Should retrieve recv timeout without connect +--SKIPIF-- +getRecvTimeout(); +--EXPECTF-- +Warning: Zookeeper::getRecvTimeout(): Zookeeper connect was not called in %s on line %d diff --git a/tests/retrieve_state.phpt b/tests/retrieve_state.phpt index bba0ab4..179c7a6 100644 --- a/tests/retrieve_state.phpt +++ b/tests/retrieve_state.phpt @@ -9,5 +9,5 @@ if (!extension_loaded('zookeeper')) { getState(); ---EXPECT-- -999 +--EXPECTF-- +%d diff --git a/tests/retrieve_state_without_connect.phpt b/tests/retrieve_state_without_connect.phpt new file mode 100644 index 0000000..da86fcc --- /dev/null +++ b/tests/retrieve_state_without_connect.phpt @@ -0,0 +1,13 @@ +--TEST-- +Should get state without connect +--SKIPIF-- +getState(); +--EXPECTF-- +Warning: Zookeeper::getState(): Zookeeper connect was not called in %s on line %d diff --git a/tests/set_node_value_without_connect.phpt b/tests/set_node_value_without_connect.phpt new file mode 100644 index 0000000..548b75d --- /dev/null +++ b/tests/set_node_value_without_connect.phpt @@ -0,0 +1,13 @@ +--TEST-- +Test should set node value without connect +--SKIPIF-- +set('/test1', 'something'); +--EXPECTF-- +Warning: Zookeeper::set(): Zookeeper connect was not called in %s on line %d diff --git a/tests/set_null_value_and_stats_in_node.phpt b/tests/set_null_value_and_stats_in_node.phpt new file mode 100644 index 0000000..f26ae2b --- /dev/null +++ b/tests/set_null_value_and_stats_in_node.phpt @@ -0,0 +1,24 @@ +--TEST-- +Set null value and stats in node +--SKIPIF-- +create('/tes', null, array( + array( + 'perms' => Zookeeper::PERM_ALL, + 'scheme' => 'world', + 'id' => 'anyone' + ) +)); + +$stat = array('test' => 'zoo'); +$client->set('/tes', null, -1, $stat); +echo gettype($client->get('/tes')); +$client->delete('/tes'); +--EXPECT-- +NULL diff --git a/tests/set_should_throw_error_with_invalid_node.phpt b/tests/set_should_throw_error_with_invalid_node.phpt new file mode 100644 index 0000000..a765f11 --- /dev/null +++ b/tests/set_should_throw_error_with_invalid_node.phpt @@ -0,0 +1,13 @@ +--TEST-- +Set should throw error with invalid node +--SKIPIF-- +set('/t', 't'); +--EXPECTF-- +Warning: Zookeeper::set(): error: no node in %s on line %d diff --git a/tests/set_should_throw_error_with_invalid_param.phpt b/tests/set_should_throw_error_with_invalid_param.phpt new file mode 100644 index 0000000..ce03bbb --- /dev/null +++ b/tests/set_should_throw_error_with_invalid_param.phpt @@ -0,0 +1,13 @@ +--TEST-- +Set should throw error with invalid paramater +--SKIPIF-- +set(array()); +--EXPECTF-- +Warning: Zookeeper::set() expects at least %d parameters, %d given in %s on line %d diff --git a/tests/set_watcher.phpt b/tests/set_watcher.phpt new file mode 100644 index 0000000..c432b7e --- /dev/null +++ b/tests/set_watcher.phpt @@ -0,0 +1,18 @@ +--TEST-- +Should set watcher +--SKIPIF-- +setWatcher('callback')); +--EXPECTF-- +boolean diff --git a/tests/setacl_should_throw_error_with_invalid_param.phpt b/tests/setacl_should_throw_error_with_invalid_param.phpt new file mode 100644 index 0000000..b7206f2 --- /dev/null +++ b/tests/setacl_should_throw_error_with_invalid_param.phpt @@ -0,0 +1,13 @@ +--TEST-- +Set acl should throw erro with invalid param +--SKIPIF-- +setAcl(array()); +--EXPECTF-- +Warning: Zookeeper::setAcl() expects exactly %d parameters, %d given in %s on line %d diff --git a/tests/should_set_acl.phpt b/tests/should_set_acl.phpt new file mode 100644 index 0000000..cc942e9 --- /dev/null +++ b/tests/should_set_acl.phpt @@ -0,0 +1,31 @@ +--TEST-- +Test should set acl +--SKIPIF-- +create('/tes', null, array( + array( + 'perms' => Zookeeper::PERM_ALL, + 'scheme' => 'world', + 'id' => 'anyone' + ) +)); + +$client->setAcl('/tes', -1, array( + array( + 'perms' => Zookeeper::PERM_ALL, + 'scheme' => 'world', + 'id' => 'anyone' + ) +)); + +$acl = $client->getAcl('/zookeeper'); +echo $acl[1][0]['perms'] === Zookeeper::PERM_ALL; +$client->delete('/tes'); +--EXPECT-- +1 diff --git a/tests/should_set_acl_with_invalid_path.phpt b/tests/should_set_acl_with_invalid_path.phpt new file mode 100644 index 0000000..774eda7 --- /dev/null +++ b/tests/should_set_acl_with_invalid_path.phpt @@ -0,0 +1,19 @@ +--TEST-- +Test should set acl with invalid path +--SKIPIF-- +setAcl('/tesa', -1, array( + array( + 'perms' => Zookeeper::PERM_ALL, + 'scheme' => 'world', + 'id' => 'anyone' + ) +)); +--EXPECTF-- +Warning: Zookeeper::setAcl(): error: no node in %s on line %d diff --git a/tests/should_set_acl_without_connect.phpt b/tests/should_set_acl_without_connect.phpt new file mode 100644 index 0000000..5a613ef --- /dev/null +++ b/tests/should_set_acl_without_connect.phpt @@ -0,0 +1,19 @@ +--TEST-- +Test should set acl without connect +--SKIPIF-- +setAcl('/tes', -1, array( + array( + 'perms' => Zookeeper::PERM_ALL, + 'scheme' => 'world', + 'id' => 'anyone' + ) +)); +--EXPECTF-- +Warning: Zookeeper::setAcl(): Zookeeper connect was not called in %s on line %d diff --git a/tests/should_set_debug_level.phpt b/tests/should_set_debug_level.phpt new file mode 100644 index 0000000..0227562 --- /dev/null +++ b/tests/should_set_debug_level.phpt @@ -0,0 +1,13 @@ +--TEST-- +Test should set debug level +--SKIPIF-- +setDebugLevel(Zookeeper::LOG_LEVEL_WARN); +--EXPECT-- +1 diff --git a/tests/should_set_debug_level_with_invalid_param.phpt b/tests/should_set_debug_level_with_invalid_param.phpt new file mode 100644 index 0000000..37daa48 --- /dev/null +++ b/tests/should_set_debug_level_with_invalid_param.phpt @@ -0,0 +1,13 @@ +--TEST-- +Test should set debug level with invalid parameter +--SKIPIF-- +setDebugLevel(array()); +--EXPECTF-- +Warning: Zookeeper::setDebugLevel() expects parameter %d to be long, array given in %s on line %d diff --git a/tests/should_set_deterministic_conn_order.phpt b/tests/should_set_deterministic_conn_order.phpt new file mode 100644 index 0000000..c5e5c8c --- /dev/null +++ b/tests/should_set_deterministic_conn_order.phpt @@ -0,0 +1,13 @@ +--TEST-- +Test should set deterministic conn order +--SKIPIF-- +setDeterministicConnOrder(false); +--EXPECT-- +1 diff --git a/tests/should_set_deterministic_conn_order_with_invalid_param.phpt b/tests/should_set_deterministic_conn_order_with_invalid_param.phpt new file mode 100644 index 0000000..f49f942 --- /dev/null +++ b/tests/should_set_deterministic_conn_order_with_invalid_param.phpt @@ -0,0 +1,13 @@ +--TEST-- +Test should set deterministic conn order with invalid parameter +--SKIPIF-- +setDeterministicConnOrder(array()); +--EXPECTF-- +Warning: Zookeeper::setDeterministicConnOrder() expects parameter %d to be boolean, array given in %s on line %d diff --git a/tests/should_set_log_stream_with_invalid_param.phpt b/tests/should_set_log_stream_with_invalid_param.phpt new file mode 100644 index 0000000..7ee8e09 --- /dev/null +++ b/tests/should_set_log_stream_with_invalid_param.phpt @@ -0,0 +1,13 @@ +--TEST-- +Test should set log stream with invalid parameter +--SKIPIF-- +setLogStream('/tmp/log.log', ''); +--EXPECTF-- +Warning: Zookeeper::setLogStream() expects exactly %d parameter, %d given in %s on line %d diff --git a/tests/should_set_log_stream_with_resource.phpt b/tests/should_set_log_stream_with_resource.phpt new file mode 100644 index 0000000..8887f69 --- /dev/null +++ b/tests/should_set_log_stream_with_resource.phpt @@ -0,0 +1,14 @@ +--TEST-- +Test should set log stream with resource +--SKIPIF-- +setLogStream($temp); +--EXPECT-- +1 diff --git a/tests/should_set_log_stream_with_string_path.phpt b/tests/should_set_log_stream_with_string_path.phpt new file mode 100644 index 0000000..0976801 --- /dev/null +++ b/tests/should_set_log_stream_with_string_path.phpt @@ -0,0 +1,13 @@ +--TEST-- +Test should set log stream with string path file +--SKIPIF-- +setLogStream('/tmp/test.log'); +--EXPECT-- +1 diff --git a/tests/should_set_node_value.phpt b/tests/should_set_node_value.phpt new file mode 100644 index 0000000..9307677 --- /dev/null +++ b/tests/should_set_node_value.phpt @@ -0,0 +1,24 @@ +--TEST-- +Test should set node value +--SKIPIF-- +create('/test1', null, array( + array( + 'perms' => Zookeeper::PERM_ALL, + 'scheme' => 'world', + 'id' => 'anyone' + ) +)); + +$client->set('/test1', 'something'); +echo $client->get('/test1'); + +$client->delete('/test1'); +--EXPECT-- +something diff --git a/tests/throw_error_when_add_auth.phpt b/tests/throw_error_when_add_auth.phpt new file mode 100644 index 0000000..697ebe8 --- /dev/null +++ b/tests/throw_error_when_add_auth.phpt @@ -0,0 +1,13 @@ +--TEST-- +Should throw error when add auth +--SKIPIF-- +addAuth(array()); +--EXPECTF-- +Warning: Zookeeper::addAuth() expects at least %d parameters, %d given in %s on line %d diff --git a/tests/throw_error_when_add_auth_without_connect.phpt b/tests/throw_error_when_add_auth_without_connect.phpt new file mode 100644 index 0000000..5dcab70 --- /dev/null +++ b/tests/throw_error_when_add_auth_without_connect.phpt @@ -0,0 +1,13 @@ +--TEST-- +Should throw error when add auth without connect +--SKIPIF-- +addAuth('t', 't'); +--EXPECTF-- +Warning: Zookeeper::addAuth(): Zookeeper connect was not called in %s on line %d diff --git a/tests/throw_error_when_get_non_existent_node.phpt b/tests/throw_error_when_get_non_existent_node.phpt new file mode 100644 index 0000000..a05bb02 --- /dev/null +++ b/tests/throw_error_when_get_non_existent_node.phpt @@ -0,0 +1,13 @@ +--TEST-- +Throw error when get non existent node +--SKIPIF-- +get('/test1'); +--EXPECTF-- +Warning: Zookeeper::get(): error: no node in %s on line %d diff --git a/tests/throw_error_when_set_param_in_isrecoverable.phpt b/tests/throw_error_when_set_param_in_isrecoverable.phpt new file mode 100644 index 0000000..35080b1 --- /dev/null +++ b/tests/throw_error_when_set_param_in_isrecoverable.phpt @@ -0,0 +1,13 @@ +--TEST-- +Throw error when set parameter in isRecoverable method +--SKIPIF-- +isRecoverable('t'); +--EXPECTF-- +Warning: Zookeeper::isRecoverable() expects exactly %d parameters, %d given in %s on line %d diff --git a/tests/throw_error_when_set_watcher_with_invalid_param.phpt b/tests/throw_error_when_set_watcher_with_invalid_param.phpt new file mode 100644 index 0000000..55e2257 --- /dev/null +++ b/tests/throw_error_when_set_watcher_with_invalid_param.phpt @@ -0,0 +1,13 @@ +--TEST-- +Throw error when set watcher with invalid parameter +--SKIPIF-- +setWatcher(array()); +--EXPECTF-- +Warning: Zookeeper::setWatcher() expects parameter %s to be a valid callback, array must have exactly two members in %s on line %d