Skip to content

Commit 440c2ba

Browse files
committed
Make PhpUnit more verbose when tests have warnings
1 parent 27702f3 commit 440c2ba

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Diff for: phpunit.xml

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
colors="true"
77
executionOrder="defects"
88
cacheDirectory=".phpunit.cache"
9+
displayDetailsOnTestsThatTriggerWarnings="true"
910
>
1011
<testsuites>
1112
<testsuite name="main">

Diff for: src/Rector/MethodCall/EloquentOrderByToLatestOrOldestRector.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,9 @@ private function isOrderByMethodCall(MethodCall $methodCall): bool
112112

113113
private function isAllowedPattern(MethodCall $methodCall): bool
114114
{
115-
$columnArg = $methodCall->args[0] instanceof Arg ? $methodCall->args[0]->value : null;
115+
$columnArg = $methodCall->args !== [] && $methodCall->args[0] instanceof Arg
116+
? $methodCall->args[0]->value
117+
: null;
116118

117119
// If no patterns are specified, consider all column names as matching
118120
if ($this->allowedPatterns === []) {

0 commit comments

Comments
 (0)