Skip to content

Commit

Permalink
Add documentation for html handler.
Browse files Browse the repository at this point in the history
  • Loading branch information
shulard committed Feb 27, 2017
1 parent 6e9dbfc commit 02ce500
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# shulard/atoum-xml-extension [![Build Status](https://travis-ci.org/shulard/atoum-xml-extension.svg?branch=master)](https://travis-ci.org/shulard/atoum-xml-extension) [![Latest Stable Version](https://img.shields.io/packagist/v/shulard/atoum-xml-extension.svg)](https://packagist.org/packages/shulard/atoum-xml-extension)

This atoum extension allows you to test XML document using [atoum](https://github.com/atoum/atoum). It's possible to execute
xpath against the document or to validate it using DTD, XSD or RelaxNG schema.
xpath against the document or to validate it using DTD, XSD or RelaxNG schema. You can use it to validate HTML documents too.

## Example

Expand Down Expand Up @@ -185,6 +185,25 @@ XML;
->relaxNg('/path/to/file.rng')
;
}

/**
* You can also make tests on HTML Document
*/
public function testOnHtmlDocument()
{
$this
->then
->html(file_get_contents('http://example.com'))
->xpath('//title')
->item(0)
->nodevalue
->isEqualTo('My awesome title')
->xpath('//body/script')
->last()
->nodevalue
->contains('GMTXXXXXX');
;
}
}
```

Expand Down

0 comments on commit 02ce500

Please sign in to comment.