1212
1313namespace phpDocumentor \Reflection \Php ;
1414
15+ use phpDocumentor \Reflection \Types \Mixed_ ;
16+ use phpDocumentor \Reflection \Types \String_ ;
1517use PHPUnit \Framework \TestCase ;
1618
1719/**
1820 * Tests the functionality for the Argument class.
19- * @coversDefaultClass phpDocumentor\Reflection\Php\Argument
21+ * @coversDefaultClass \ phpDocumentor\Reflection\Php\Argument
2022 */
2123class ArgumentTest extends TestCase
2224{
2325 /**
24- * @covers ::getTypes
25- * @covers ::addType
26+ * @covers ::getType
2627 */
2728 public function testGetTypes ()
2829 {
29- $ argument = new Argument ('myArgument ' , 'myDefaultValue ' , true , true );
30- $ this ->assertSame ([] , $ argument ->getTypes ());
30+ $ argument = new Argument ('myArgument ' , null , 'myDefaultValue ' , true , true );
31+ $ this ->assertInstanceOf (Mixed_::class , $ argument ->getType ());
3132
32- $ argument ->addType (1 );
33-
34- $ this ->assertSame ([1 ], $ argument ->getTypes ());
33+ $ argument = new Argument (
34+ 'myArgument ' ,
35+ new String_ (),
36+ 'myDefaultValue ' ,
37+ true ,
38+ true
39+ );
40+ $ this ->assertEquals (new String_ (), $ argument ->getType ());
3541 }
3642
3743 /**
@@ -50,10 +56,10 @@ public function testGetName()
5056 */
5157 public function testGetDefault ()
5258 {
53- $ argument = new Argument ('myArgument ' , 'myDefaultValue ' , true , true );
59+ $ argument = new Argument ('myArgument ' , null , 'myDefaultValue ' , true , true );
5460 $ this ->assertEquals ('myDefaultValue ' , $ argument ->getDefault ());
5561
56- $ argument = new Argument ('myArgument ' , null , true , true );
62+ $ argument = new Argument ('myArgument ' , null , null , true , true );
5763 $ this ->assertNull ($ argument ->getDefault ());
5864 }
5965
@@ -63,10 +69,10 @@ public function testGetDefault()
6369 */
6470 public function testGetWhetherArgumentIsPassedByReference ()
6571 {
66- $ argument = new Argument ('myArgument ' , 'myDefaultValue ' , true , true );
72+ $ argument = new Argument ('myArgument ' , null , 'myDefaultValue ' , true , true );
6773 $ this ->assertTrue ($ argument ->isByReference ());
6874
69- $ argument = new Argument ('myArgument ' , null , false , true );
75+ $ argument = new Argument ('myArgument ' , null , null , false , true );
7076 $ this ->assertFalse ($ argument ->isByReference ());
7177 }
7278
@@ -76,10 +82,10 @@ public function testGetWhetherArgumentIsPassedByReference()
7682 */
7783 public function testGetWhetherArgumentisVariadic ()
7884 {
79- $ argument = new Argument ('myArgument ' , 'myDefaultValue ' , true , true );
85+ $ argument = new Argument ('myArgument ' , null , 'myDefaultValue ' , true , true );
8086 $ this ->assertTrue ($ argument ->isVariadic ());
8187
82- $ argument = new Argument ('myArgument ' , 'myDefaultValue ' , true , false );
88+ $ argument = new Argument ('myArgument ' , null , 'myDefaultValue ' , true , false );
8389 $ this ->assertFalse ($ argument ->isVariadic ());
8490 }
8591}
0 commit comments