mbhsoft / phpunit-xsdvalidation
XSD schema validation constraint for PHPUnit
3.0.0
2022-11-17 22:17 UTC
Requires
- php: ^8.0
- ext-dom: *
- ext-libxml: *
- ext-simplexml: *
- phpunit/phpunit: ^9.0
README
Installation
composer install jasny/phpunit-xsdvalidation
Usage
$constraint = new Jasny\PHPUnit\Constraint\XSDValidation("myschema.xsd");
$xml = $this->object->doSomething();
$this->assertThat($xml, $constraint);
Usage with mock object
$constraint = new Jasny\PHPUnit\Constraint\XSDValidation("myschema.xsd");
$mock = $this->getMock('Foo\Bar', ['doSomething']);
$mock->expects($this->once())
->method('doSomething')
->with($constraint);