PHPLIB-482: Add missing error expectation to crud tests

parent 6405e91b
...@@ -75,6 +75,17 @@ final class ErrorExpectation ...@@ -75,6 +75,17 @@ final class ErrorExpectation
return $o; return $o;
} }
public static function fromCrud(stdClass $result)
{
$o = new self();
if (isset($result->error)) {
$o->isExpected = $result->error;
}
return $o;
}
public static function fromRetryableReads(stdClass $operation) public static function fromRetryableReads(stdClass $operation)
{ {
$o = new self(); $o = new self();
......
...@@ -158,6 +158,7 @@ final class Operation ...@@ -158,6 +158,7 @@ final class Operation
{ {
$o = new self($operation); $o = new self($operation);
$o->errorExpectation = ErrorExpectation::fromCrud($operation);
$o->resultExpectation = ResultExpectation::fromCrud($operation, $o->getResultAssertionType()); $o->resultExpectation = ResultExpectation::fromCrud($operation, $o->getResultAssertionType());
if (isset($operation->collectionOptions)) { if (isset($operation->collectionOptions)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment