66use InvalidArgumentException ;
77use PHPUnit \Framework \TestCase ;
88use StdClass ;
9+ use TraderInteractive \Exceptions \FilterException ;
910
1011/**
1112 * @coversDefaultClass \TraderInteractive\Filterer
@@ -488,7 +489,7 @@ public function ofScalarsFail()
488489 try {
489490 Filterer::ofScalars (['1 ' , [], new \StdClass ], [['string ' ]]);
490491 $ this ->fail ();
491- } catch (Exception $ e ) {
492+ } catch (FilterException $ e ) {
492493 $ expected = <<<TXT
493494Field '1' with value 'array (
494495)' failed filtering, message 'Value 'array (
@@ -549,7 +550,7 @@ public function ofArraysFail()
549550 ['key ' => [['string ' ]]]
550551 );
551552 $ this ->fail ();
552- } catch (Exception $ e ) {
553+ } catch (FilterException $ e ) {
553554 $ expected = <<<TXT
554555Field 'key' with value 'stdClass::__set_state(array(
555556))' failed filtering, message 'Value 'stdClass::__set_state(array(
@@ -606,7 +607,7 @@ public function ofArrayRequiredFail()
606607 try {
607608 Filterer::ofArray (['key1 ' => '1 ' ], ['key1 ' => [['uint ' ]], 'key2 ' => ['required ' => true , ['uint ' ]]]);
608609 $ this ->fail ();
609- } catch (Exception $ e ) {
610+ } catch (FilterException $ e ) {
610611 $ expected = "Field 'key2' was required and not present " ;
611612 $ this ->assertSame ($ expected , $ e ->getMessage ());
612613 }
@@ -621,7 +622,7 @@ public function ofArrayUnknown()
621622 try {
622623 Filterer::ofArray (['key ' => '1 ' ], ['key2 ' => [['uint ' ]]]);
623624 $ this ->fail ();
624- } catch (Exception $ e ) {
625+ } catch (FilterException $ e ) {
625626 $ expected = "Field 'key' with value '1' is unknown " ;
626627 $ this ->assertSame ($ expected , $ e ->getMessage ());
627628 }
0 commit comments