Skip to content

Commit 988a757

Browse files
committed
do not rely that much on error message
Conflicts: tests/TransactionTest.php
1 parent f6b1745 commit 988a757

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

tests/TransactionTest.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -352,13 +352,9 @@ function () {
352352
}
353353
$details = $e->getDetails();
354354
$expectedCutDownMessage = "unique constraint violated";
355-
$len = strlen($expectedCutDownMessage);
356355
$this->assertTrue(
357-
$e->getCode() == 400 && substr(
358-
$details['errorMessage'],
359-
0,
360-
$len
361-
) == $expectedCutDownMessage,
356+
$e->getCode() == 400 && strstr($details['errorMessage'],
357+
$expectedCutDownMessage) !== false,
362358
'Did not return code 400 with first part of the message: "' . $expectedCutDownMessage . '", instead returned: ' . $e->getCode(
363359
) . ' and "' . $details['errorMessage'] . '"'
364360
);

0 commit comments

Comments
 (0)