Archive for the tag 'unit testing'

XMLUnit: JUnit and NUnit testing for XML

XMLUnit [1] for Java provides two JUnit extension classes, XMLAssert and XMLTestCase, and a set of supporting classes (e.g. Diff, DetailedDiff, Transform, SimpleXpathEngine, Validator, NodeTest) that allow assertions to be made about:

  • The differences between two pieces of XML
  • The outcome of transforming a piece of XML using XSLT
  • The evaluation of an XPath expression on a piece of XML
  • The validity of a piece of XML
  • Individual nodes in a piece of XML that are exposed by DOM Traversal

XMLUnit for Java can also treat HTML content (even badly-formed HTML) as valid XML to allow these assertions to be made about the content of web pages too.

[1] http://xmlunit.sourceforge.net/

ztest: Unit Testing for PHP 5.3

ztest [1] is new unit testing library designing to take advantage of the new features of PHP5.3 – namely namespaces and closures. It was extracted from the BasePHP [2] library, a perpetual work-in-progress.

Released under the MIT License.

[1] http://github.com/jaz303/ztest
[2] http://www.phpbase.org/