99namespace Ibexa \Tests \Rest \Server \Input \Parser ;
1010
1111use Ibexa \Contracts \Core \Repository \LocationService ;
12- use Ibexa \Contracts \Rest \Exceptions \Parser ;
1312use Ibexa \Core \Repository \Values \Content \Location ;
13+ use Ibexa \Rest \Server \Exceptions \ValidationFailedException ;
1414use Ibexa \Rest \Server \Input \Parser \AbstractDestinationLocationParser ;
1515use PHPUnit \Framework \MockObject \MockObject ;
1616use Symfony \Component \Validator \Validator \ValidatorInterface ;
@@ -52,10 +52,12 @@ protected function parse(): void
5252 );
5353 }
5454
55- protected function parseExceptionOnMissingDestinationElement (): void
55+ protected function parseExceptionOnMissingDestinationElement (string $ parser ): void
5656 {
57- $ this ->expectException (Parser::class);
58- $ this ->expectExceptionMessage ("The 'destination' element is malformed or missing. " );
57+ $ this ->expectException (ValidationFailedException::class);
58+ $ this ->expectExceptionMessage (
59+ sprintf ('Input data validation failed for %s ' , $ parser ),
60+ );
5961
6062 $ inputArray = [
6163 'new_destination ' => '/1/2/3 ' ,
@@ -66,16 +68,18 @@ protected function parseExceptionOnMissingDestinationElement(): void
6668 $ sessionInput ->parse ($ inputArray , $ this ->getParsingDispatcherMock ());
6769 }
6870
69- protected function parseExceptionOnInvalidDestinationElement (): void
71+ protected function parseExceptionOnInvalidDestinationElement (string $ parser ): void
7072 {
7173 $ inputArray = [
7274 'destination ' => 'test_destination ' ,
7375 ];
7476
7577 $ sessionInput = $ this ->getParser ();
7678
77- $ this ->expectException (Parser::class);
78- $ this ->expectExceptionMessage ("The 'destination' element is malformed or missing. " );
79+ $ this ->expectException (ValidationFailedException::class);
80+ $ this ->expectExceptionMessage (
81+ sprintf ('Input data validation failed for %s ' , $ parser ),
82+ );
7983
8084 $ sessionInput ->parse ($ inputArray , $ this ->getParsingDispatcherMock ());
8185 }
0 commit comments