Skip to content

Commit

Permalink
Fix test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Timandes committed Jun 23, 2018
1 parent d3e1e39 commit 89a27c4
Show file tree
Hide file tree
Showing 82 changed files with 250 additions and 247 deletions.
5 changes: 4 additions & 1 deletion tests/001.phpt
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
--TEST--
Check for zookeeper presence
--SKIPIF--
<?php if (!extension_loaded("zookeeper")) print "skip"; ?>
<?php
if (!extension_loaded('zookeeper'))
echo 'skip ZooKeeper extension is not loaded';
?>
--FILE--
<?php
echo "zookeeper extension is available";
Expand Down
8 changes: 4 additions & 4 deletions tests/ZookeeperConfig/add.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
ZookeeperConfig::add();
--SKIPIF--
<?php
if (!extension_loaded('zookeeper')) {
echo 'ZooKeeper extension is not loaded'
}
if (!extension_loaded('zookeeper'))
echo 'skip ZooKeeper extension is not loaded';
if (!class_exists('ZookeeperConfig'))
echo 'Skipping';
echo 'skip Class ZookeeperConfig is not defined';
?>
--FILE--
<?php
Expand All @@ -18,6 +17,7 @@ $zkConfig->set("server.1=localhost:2888:3888:participant;0.0.0.0:2181");

$zkConfig->add("server.2=localhost:2889:3889:participant;0.0.0.0:2182");
echo $zkConfig->get();
?>
--EXPECTF--
server.1=localhost:2888:3888:participant;0.0.0.0:2181
server.2=localhost:2889:3889:participant;0.0.0.0:2182
Expand Down
7 changes: 3 additions & 4 deletions tests/ZookeeperConfig/remove.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
ZookeeperConfig::remove();
--SKIPIF--
<?php
if (!extension_loaded('zookeeper')) {
echo 'ZooKeeper extension is not loaded'
}
if (!extension_loaded('zookeeper'))
echo 'skip ZooKeeper extension is not loaded';
if (!class_exists('ZookeeperConfig'))
echo 'Skipping';
echo 'skip Class ZookeeperConfig is not defined';
?>
--FILE--
<?php
Expand Down
7 changes: 3 additions & 4 deletions tests/ZookeeperConfig/set_n_get.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
ZookeeperConfig::set() & ZookeeperConfig::get()
--SKIPIF--
<?php
if (!extension_loaded('zookeeper')) {
echo 'ZooKeeper extension is not loaded'
}
if (!extension_loaded('zookeeper'))
echo 'skip ZooKeeper extension is not loaded';
if (!class_exists('ZookeeperConfig'))
echo 'Skipping';
echo 'skip Class ZookeeperConfig is not defined';
?>
--FILE--
<?php
Expand Down
7 changes: 3 additions & 4 deletions tests/ZookeeperConfig/set_with_no_auth.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
ZookeeperConfig::set() with no auth
--SKIPIF--
<?php
if (!extension_loaded('zookeeper')) {
echo 'ZooKeeper extension is not loaded'
}
if (!extension_loaded('zookeeper'))
echo 'skip ZooKeeper extension is not loaded';
if (!class_exists('ZookeeperConfig'))
echo 'Skipping';
echo 'skip Class ZookeeperConfig is not defined';
?>
--FILE--
<?php
Expand Down
6 changes: 3 additions & 3 deletions tests/add_auth.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
Should add auth
--SKIPIF--
<?php
if (!extension_loaded('zookeeper')) {
echo 'Zookeeper extension is not loaded'
};
if (!extension_loaded('zookeeper'))
echo 'skip ZooKeeper extension is not loaded';
?>
--FILE--
<?php
$client = new Zookeeper('localhost:2181');
Expand Down
6 changes: 3 additions & 3 deletions tests/add_auth_with_callback.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
Should add auth and trigger completion callback
--SKIPIF--
<?php
if (!extension_loaded('zookeeper')) {
echo 'Zookeeper extension is not loaded'
};
if (!extension_loaded('zookeeper'))
echo 'skip ZooKeeper extension is not loaded';
?>
--FILE--
<?php
$fh = fopen('/dev/null', 'w');
Expand Down
6 changes: 3 additions & 3 deletions tests/check_if_exists_after_closing.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
Should check if node exists after closing
--SKIPIF--
<?php
if (!extension_loaded('zookeeper')) {
echo 'ZooKeeper extension is not loaded'
};
if (!extension_loaded('zookeeper'))
echo 'skip ZooKeeper extension is not loaded';
?>
--FILE--
<?php
$client = new Zookeeper();
Expand Down
6 changes: 3 additions & 3 deletions tests/check_if_exists_without_connect.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
Should check if node exists without connect
--SKIPIF--
<?php
if (!extension_loaded('zookeeper')) {
echo 'Zookeeper extension is not loaded'
};
if (!extension_loaded('zookeeper'))
echo 'skip ZooKeeper extension is not loaded';
?>
--FILE--
<?php
$client = new Zookeeper();
Expand Down
6 changes: 3 additions & 3 deletions tests/close.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
Should connect to the ZooKeeper and close it
--SKIPIF--
<?php
if (!extension_loaded('zookeeper')) {
echo 'ZooKeeper extension is not loaded'
};
if (!extension_loaded('zookeeper'))
echo 'skip ZooKeeper extension is not loaded';
?>
--FILE--
<?php
$client = new Zookeeper();
Expand Down
6 changes: 3 additions & 3 deletions tests/connect.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
Should connect the Zookeeper
--SKIPIF--
<?php
if (!extension_loaded('zookeeper')) {
echo 'Zookeeper extension is not loaded'
};
if (!extension_loaded('zookeeper'))
echo 'skip ZooKeeper extension is not loaded';
?>
--FILE--
<?php
$client = new Zookeeper();
Expand Down
6 changes: 3 additions & 3 deletions tests/connect_with_invalid_param.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
Should connect the Zookeeper with invalid parameter
--SKIPIF--
<?php
if (!extension_loaded('zookeeper')) {
echo 'Zookeeper extension is not loaded'
};
if (!extension_loaded('zookeeper'))
echo 'skip ZooKeeper extension is not loaded';
?>
--FILE--
<?php
$client = new Zookeeper();
Expand Down
6 changes: 3 additions & 3 deletions tests/construct.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
Should construct
--SKIPIF--
<?php
if (!extension_loaded('zookeeper')) {
echo 'Zookeeper extension is not loaded'
};
if (!extension_loaded('zookeeper'))
echo 'skip ZooKeeper extension is not loaded';
?>
--FILE--
<?php
$client = new Zookeeper();
Expand Down
6 changes: 3 additions & 3 deletions tests/construct_and_connect.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
Should construct and connect the zookeeper
--SKIPIF--
<?php
if (!extension_loaded('zookeeper')) {
echo 'Zookeeper extension is not loaded'
};
if (!extension_loaded('zookeeper'))
echo 'skip ZooKeeper extension is not loaded';
?>
--FILE--
<?php
$client = new Zookeeper('localhost:2181');
Expand Down
6 changes: 3 additions & 3 deletions tests/construct_retrieve_error_with_invalid_recv.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
Should construct and connect the zookeeper
--SKIPIF--
<?php
if (!extension_loaded('zookeeper')) {
echo 'Zookeeper extension is not loaded'
};
if (!extension_loaded('zookeeper'))
echo 'skip ZooKeeper extension is not loaded';
?>
--FILE--
<?php
try {
Expand Down
6 changes: 3 additions & 3 deletions tests/construct_with_invalid_param.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
Should construct with invalid parameters
--SKIPIF--
<?php
if (!extension_loaded('zookeeper')) {
echo 'Zookeeper extension is not loaded'
};
if (!extension_loaded('zookeeper'))
echo 'skip ZooKeeper extension is not loaded';
?>
--FILE--
<?php
$client = new Zookeeper('localhost:2181', 10);
Expand Down
6 changes: 3 additions & 3 deletions tests/create_node.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
Should create node
--SKIPIF--
<?php
if (!extension_loaded('zookeeper')) {
echo 'Zookeeper extension is not loaded'
};
if (!extension_loaded('zookeeper'))
echo 'skip ZooKeeper extension is not loaded';
?>
--FILE--
<?php
$client = new Zookeeper('localhost:2181');
Expand Down
6 changes: 3 additions & 3 deletions tests/create_node_after_closing_and_connecting_again.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
Should create node after closing and connecting again
--SKIPIF--
<?php
if (!extension_loaded('zookeeper')) {
echo 'ZooKeeper extension is not loaded'
};
if (!extension_loaded('zookeeper'))
echo 'skip ZooKeeper extension is not loaded';
?>
--FILE--
<?php
$client = new Zookeeper('localhost:2181');
Expand Down
6 changes: 3 additions & 3 deletions tests/create_node_retrieve_invalid_status_error.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
Should throw error when retrieve invalid status
--SKIPIF--
<?php
if (!extension_loaded('zookeeper')) {
echo 'Zookeeper extension is not loaded'
};
if (!extension_loaded('zookeeper'))
echo 'skip ZooKeeper extension is not loaded';
?>
--FILE--
<?php
$client = new Zookeeper('localhost:2181');
Expand Down
6 changes: 3 additions & 3 deletions tests/create_node_with_invalid_param.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
Should throw error when create node with invalid parameter
--SKIPIF--
<?php
if (!extension_loaded('zookeeper')) {
echo 'Zookeeper extension is not loaded'
};
if (!extension_loaded('zookeeper'))
echo 'skip ZooKeeper extension is not loaded';
?>
--FILE--
<?php
$client = new Zookeeper('localhost:2181');
Expand Down
6 changes: 3 additions & 3 deletions tests/create_node_without_connect.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
Should create node without connect
--SKIPIF--
<?php
if (!extension_loaded('zookeeper')) {
echo 'Zookeeper extension is not loaded'
};
if (!extension_loaded('zookeeper'))
echo 'skip ZooKeeper extension is not loaded';
?>
--FILE--
<?php
$client = new Zookeeper();
Expand Down
6 changes: 3 additions & 3 deletions tests/exists_retrieve_error_with_invalid_param.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
Should retrieve error when set invalid parameter
--SKIPIF--
<?php
if (!extension_loaded('zookeeper')) {
echo 'Zookeeper extension is not loaded'
};
if (!extension_loaded('zookeeper'))
echo 'skip ZooKeeper extension is not loaded';
?>
--FILE--
<?php
$client = new Zookeeper('localhost:2181');
Expand Down
6 changes: 3 additions & 3 deletions tests/exists_with_invalid_param.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
Should retrieve error when set invalid data in second parameter
--SKIPIF--
<?php
if (!extension_loaded('zookeeper')) {
echo 'Zookeeper extension is not loaded'
};
if (!extension_loaded('zookeeper'))
echo 'skip ZooKeeper extension is not loaded';
?>
--FILE--
<?php
$client = new Zookeeper('localhost:2181');
Expand Down
6 changes: 3 additions & 3 deletions tests/extension_info.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
Show extension info
--SKIPIF--
<?php
if (!extension_loaded('zookeeper')) {
echo 'Zookeeper extension is not loaded'
};
if (!extension_loaded('zookeeper'))
echo 'skip ZooKeeper extension is not loaded';
?>
--FILE--
<?php

Expand Down
7 changes: 5 additions & 2 deletions tests/getConfig.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ Zookeeper::getConfig()
--SKIPIF--
<?php
if (!extension_loaded('zookeeper')) {
echo 'ZooKeeper extension is not loaded'
};
echo 'skip ZooKeeper extension is not loaded';
}
if (!class_exists('ZookeeperConfig'))
echo 'skip Class ZookeeperConfig is not defined';
?>
--FILE--
<?php
$client = new Zookeeper();
Expand Down
6 changes: 3 additions & 3 deletions tests/gh-az-issue-29.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
AndreiZ/php-zookeeper's issue #29
--SKIPIF--
<?php
if (!extension_loaded('zookeeper')) {
echo 'Zookeeper extension is not loaded';
}
if (!extension_loaded('zookeeper'))
echo 'skip ZooKeeper extension is not loaded';
?>
--FILE--
<?php
$path = '/test_az_issue_29';
Expand Down
6 changes: 3 additions & 3 deletions tests/remove_invalid_node.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
Should delete invalid node
--SKIPIF--
<?php
if (!extension_loaded('zookeeper')) {
echo 'Zookeeper extension is not loaded'
};
if (!extension_loaded('zookeeper'))
echo 'skip ZooKeeper extension is not loaded';
?>
--FILE--
<?php
$client = new Zookeeper('localhost:2181');
Expand Down
6 changes: 3 additions & 3 deletions tests/remove_node.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
Should delete node
--SKIPIF--
<?php
if (!extension_loaded('zookeeper')) {
echo 'Zookeeper extension is not loaded'
};
if (!extension_loaded('zookeeper'))
echo 'skip ZooKeeper extension is not loaded';
?>
--FILE--
<?php
$client = new Zookeeper('localhost:2181');
Expand Down
6 changes: 3 additions & 3 deletions tests/remove_node_with_invalid_param.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
Should throw erro when delete node with invalid paramater
--SKIPIF--
<?php
if (!extension_loaded('zookeeper')) {
echo 'Zookeeper extension is not loaded'
};
if (!extension_loaded('zookeeper'))
echo 'skip ZooKeeper extension is not loaded';
?>
--FILE--
<?php
$client = new Zookeeper('localhost:2181');
Expand Down

0 comments on commit 89a27c4

Please sign in to comment.