13 require_once(dirname(__FILE__) .
'/../common-cli.php');
23 protected function setUp() : void
32 print
"Start unit test for common-cli.php\n";
33 print
"test function cli_logger()\n";
34 $data =
"test for cli log";
36 $file_contents = file_get_contents(
"./cli.log");
37 $this->assertEquals(
"$data\n", $file_contents);
39 $file_contents = file_get_contents(
"./cli.log");
40 $this->assertEquals(
"$data\n$data\n", $file_contents);
42 $file_contents = file_get_contents(
"./cli.log");
43 $this->assertEquals(
"$data\n", $file_contents);
44 print
"unit test for common-cli.php end\n";
52 if (file_exists(
"./cli.log")) {
testcli_logger()
test for cli_logger
cli_logger($handle, $message, $mode='a')
Write/append a message to the log handle passed in.