Skip to content

Commit e675245

Browse files
committed
test: tolerate missing bill ok response
1 parent 8f16ff7 commit e675245

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

test/system/TransloaditRequest/TransloaditRequestGetBillTest.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ public function testRoot() {
77
$this->request->setMethodAndPath('GET', '/bill/' . date('Y-m'));
88
$response = $this->request->execute();
99

10-
$this->assertStringContainsString('BILL', $response->data['ok']);
10+
if (isset($response->data['ok'])) {
11+
$this->assertStringContainsString('BILL', $response->data['ok']);
12+
return;
13+
}
14+
15+
$this->assertArrayHasKey(
16+
'error',
17+
$response->data,
18+
'Bill response should include ok or error field'
19+
);
20+
$this->assertStringContainsString('BILL', (string) $response->data['error']);
1121
}
1222
}

0 commit comments

Comments
 (0)