chippyash/testdox-converter
What?
Testdox html to Markdown conversion utility. A Utility that will convert
Testdox formatted html output from PHPUnit into Markdown format, (*1)
Why?
To provide markdown formatted test contract files for inclusion in public files
for a PHP library or application., (*2)
See the Monad library test contract as an example, (*3)
When
Additions to the utility are time dependent., (*4)
If you want more, either suggest it, or better still, fork it and provide a pull request., (*5)
Check out ZF4 Packages for more packages, (*6)
How
Install the package: See below., (*7)
Assuming that you have installed into your home directory at ~/tdconv, then the
command is available at ~/tdconv/bin/tdconv., (*8)
Usage:
tdconv [-t|title="..."] sourceHtmlTestDoxFile targetMarkdownTestContractFile, (*9)
e.g.
~/tdconv/bin/tdconv -t "This is the title" myLibTest.html contract.md, (*10)
To create the testdox file, you would run phpunit with the --testdox-html option, (*11)
This is a typical build script by way of example: build.sh, (*12)
#!/bin/bash
cd ~/Projects/chippyash/source/Monad
vendor/phpunit/phpunit/phpunit -c test/phpunit.xml --testdox-html contract.html test/
tdconv -t "Chippyash Monad" contract.html docs/Test-Contract.md
rm contract.html
Changing the library
- fork it
- write the test
- amend it
- do a pull request
Found a bug you can't figure out?, (*13)
- fork it
- write the test
- do a pull request
NB. Make sure you rebase to HEAD before your pull request, (*14)
Where?
The library is hosted at Github. It is
available at Packagist.org, (*15)
Installation
Caveat: These instructions assume a Linux OS. (If you are a Windows/Mac user,
please consider adding installation and usage instructions to this repo by way
of a pull request.), (*16)
Install Composer, (*17)
Install the PHP XSL extension e.g. For debian based Linux, (*18)
apt-get install php5-xsl
PHP normally has the XML extension built-in, but you may need to install it manually., (*19)
For production
Assumes Linux OS. (If you are a Windows/Mac user, please consider adding installation
and usage instructions to this repo by way of a pull request.), (*20)
composer.phar create-project -sdev chippyash/testdox-converter tdconv, (*21)
This will download the package and install it into the ./tdconv directory.
./tdconv/bin/tdconv is a symlink to the executable. If you have a ~/bin directory
in you path you might want to move or copy the link to it, or add the bin path
to your $PATH variable., (*22)
If prompted with a "Do you want to remove the existing VCS (.git, .svn..) history?"
message, then answer "Y" (the default answer.), (*23)
For development
Clone this repo, and then run Composer in local repo root to pull in dependencies, (*24)
git clone git@github.com:chippyash/Testdox-Converter.git TDConv
cd TDConv
composer install
History
V1.0.0 Initial release, (*25)
V1.0.1 Doc update, (*26)
V1.0.2 update composer - forced by packagist composer.json format change, (*27)