File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 22
33namespace Remorhaz \JSON \Patch ;
44
5+ use Remorhaz \JSON \Data \Exception as DataException ;
56use Remorhaz \JSON \Data \SelectorInterface ;
67use Remorhaz \JSON \Pointer \Pointer ;
78
@@ -70,8 +71,11 @@ protected function performOperation(int $index)
7071 case 'test ' :
7172 $ expectedValueReader = $ this ->getPatchPointer ()->read ("/ {$ index }/value " );
7273 $ actualValueReader = $ this ->getDataPointer ()->read ($ path );
73- if ($ expectedValueReader ->getAsStruct () !== $ actualValueReader ->getAsStruct ()) {
74- throw new \RuntimeException ("Test operation failed " );
74+ try {
75+ // TODO: Make reader's test() method boolean and refactor pointer's test().
76+ $ expectedValueReader ->test ($ actualValueReader );
77+ } catch (DataException $ e ) {
78+ throw new \RuntimeException ("Test operation failed " , 0 , $ e );
7579 }
7680 break ;
7781
You can’t perform that action at this time.
0 commit comments