File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 5
5
namespace Coduo \PHPMatcher \PHPUnit ;
6
6
7
7
use Coduo \PHPMatcher \Backtrace ;
8
+ use Coduo \PHPMatcher \Backtrace \VoidBacktrace ;
8
9
use Coduo \PHPMatcher \PHPMatcher ;
9
10
use PHPUnit \Framework \Constraint \Constraint ;
10
11
use PHPUnit \Util \Json ;
@@ -42,10 +43,12 @@ public function toString() : string
42
43
43
44
protected function failureDescription ($ other ) : string
44
45
{
45
- return parent ::failureDescription ($ other )
46
- . "\nPattern: " . $ this ->exporter ()->export ($ this ->pattern )
47
- . "\nError: " . $ this ->matcher ->error ()
48
- . "\nBacktrace: \n" . $ this ->matcher ->backtrace ();
46
+ $ backtrace = $ this ->matcher ->backtrace ();
47
+
48
+ return $ backtrace instanceof VoidBacktrace
49
+ ? $ this ->matcher ->error ()
50
+ : $ this ->matcher ->error ()
51
+ . "\nBacktrace: \n" . $ this ->matcher ->backtrace ();
49
52
}
50
53
51
54
protected function matches ($ value ) : bool
You can’t perform that action at this time.
0 commit comments