chippyash/testdox-converter

Converts Testdox html into Markdown format

1.0.2 2018-02-07 23:17 UTC

This package is auto-updated.

Last update: 2024-03-22 21:33:52 UTC


README

What?

Testdox html to Markdown conversion utility. A Utility that will convert Testdox formatted html output from PHPUnit into Markdown format

Why?

To provide markdown formatted test contract files for inclusion in public files for a PHP library or application.

See the Monad library test contract as an example

When

Additions to the utility are time dependent.

If you want more, either suggest it, or better still, fork it and provide a pull request.

Check out ZF4 Packages for more packages

How

Install the package: See below.

Assuming that you have installed into your home directory at ~/tdconv, then the command is available at ~/tdconv/bin/tdconv.

Usage: tdconv [-t|title="..."] sourceHtmlTestDoxFile targetMarkdownTestContractFile

e.g. ~/tdconv/bin/tdconv -t "This is the title" myLibTest.html contract.md

To create the testdox file, you would run phpunit with the --testdox-html option

This is a typical build script by way of example: build.sh

#!/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

  1. fork it
  2. write the test
  3. amend it
  4. do a pull request

Found a bug you can't figure out?

  1. fork it
  2. write the test
  3. do a pull request

NB. Make sure you rebase to HEAD before your pull request

Where?

The library is hosted at Github. It is available at Packagist.org

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.)

Install Composer

Install the PHP XSL extension e.g. For debian based Linux

    apt-get install php5-xsl

PHP normally has the XML extension built-in, but you may need to install it manually.

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.)

composer.phar create-project -sdev chippyash/testdox-converter tdconv

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.

If prompted with a "Do you want to remove the existing VCS (.git, .svn..) history?" message, then answer "Y" (the default answer.)

For development

Clone this repo, and then run Composer in local repo root to pull in dependencies

    git clone git@github.com:chippyash/Testdox-Converter.git TDConv
    cd TDConv
    composer install

History

V1.0.0 Initial release

V1.0.1 Doc update

V1.0.2 update composer - forced by packagist composer.json format change