Skip to content

Commit b164780

Browse files
authored
Merge pull request #683 from alcaeus/add-missing-error-expectation
PHPLIB-482: Add missing error expectation to crud tests
2 parents 6405e91 + d93ca56 commit b164780

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

tests/SpecTests/ErrorExpectation.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,17 @@ public static function fromChangeStreams(stdClass $result)
7575
return $o;
7676
}
7777

78+
public static function fromCrud(stdClass $result)
79+
{
80+
$o = new self();
81+
82+
if (isset($result->error)) {
83+
$o->isExpected = $result->error;
84+
}
85+
86+
return $o;
87+
}
88+
7889
public static function fromRetryableReads(stdClass $operation)
7990
{
8091
$o = new self();

tests/SpecTests/Operation.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ public static function fromCrud(stdClass $operation)
158158
{
159159
$o = new self($operation);
160160

161+
$o->errorExpectation = ErrorExpectation::fromCrud($operation);
161162
$o->resultExpectation = ResultExpectation::fromCrud($operation, $o->getResultAssertionType());
162163

163164
if (isset($operation->collectionOptions)) {

0 commit comments

Comments
 (0)