Skip to content

Instantly share code, notes, and snippets.

@jameshd
Created October 20, 2014 11:37
Show Gist options
  • Save jameshd/934d4c69e9331b391f49 to your computer and use it in GitHub Desktop.
Save jameshd/934d4c69e9331b391f49 to your computer and use it in GitHub Desktop.
autofixtures
// usage within a test
$autoFixture->setXml('/path/to/xml')
->setExpectations(
array(
1 => array('longName' => 'Lewis Hamilton'),
2 => array('shortName' => 'L Hmltn'),
3 => array('videCode' => 'LHTN')
// etc...
)
)
$this->assertTrue($autoFixture->test());
under the hood the autoFixture could do xpath thusly...
//[1]/@longName
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment