I am trying to measure test coverage with no test framework using phpdbg
My test test script looks like this:
$ cat hello.php
<?php
if (0) {
echo "bye\n";
} else {
echo "hello\n";
}
so it just prints hello like this:
$ php hello.php
hello
by the way, this is my php version
$ php --version
PHP 7.4.3 (cli) (built: Aug 13 2021 05:39:12) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.3, Copyright (c), by Zend Technologies
I have tried to guess how to measure test coverage of this script using phpdbg
, and this is what I have come up with
$ mkdir coverage
$ phpdbg -qrr hello.php --coverage-html coverage
hello
$ find coverage
coverage/
directory is empty
I had hoped to find a coverage report in there
Does anybody know what I have to do different?