File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Alezhu \PHPUnitArrayContainsAsserts \Tests \Exception ;
4+
5+ use Alezhu \PHPUnitArrayContainsAsserts \Exception \InvalidArgumentTypeException ;
6+ use PHPUnit \Framework \InvalidArgumentException ;
7+ use PHPUnit \Framework \TestCase ;
8+
9+ class InvalidArgumentTypeExceptionTest extends TestCase
10+ {
11+
12+ public function test_create ()
13+ {
14+ $ argument = 1 ;
15+ $ type = "array " ;
16+
17+ $ instance = InvalidArgumentTypeException::create ($ argument , $ type );
18+ self ::assertInstanceOf (InvalidArgumentTypeException::class, $ instance );
19+
20+ $ result = $ instance ->getMessage ();
21+ $ expect = sprintf ("Argument #%d must be %s " , $ argument , $ type );
22+ self ::assertEquals ($ expect , $ result );
23+ }
24+
25+ public function test_1_construct ()
26+ {
27+ $ instance = new InvalidArgumentTypeException (1 , "" );
28+ self ::assertInstanceOf (InvalidArgumentTypeException::class, $ instance );
29+ self ::assertInstanceOf (InvalidArgumentException::class, $ instance );
30+ }
31+ }
You can’t perform that action at this time.
0 commit comments