jasny / phpunit-xsdvalidation
XSD schema validation constraint for PHPUnit
Installs: 2 945
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 2
Forks: 4
Open Issues: 1
Suggests
- phpunit/phpunit: This package can only be used with PHPUnit
This package is auto-updated.
Last update: 2024-11-11 19:40:40 UTC
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);