コード例 #1
0
 public function testSetAndGetArguments()
 {
     $method = new Method();
     $arguments = new ArgumentCollection();
     $arguments->add(new Argument(array('name' => 'arg1')));
     $method->setArgumentCollection($arguments);
     $this->assertInstanceOf('\\ClassGeneration\\ArgumentCollection', $method->getArgumentCollection());
     $this->assertCount(1, $method->getArgumentCollection());
 }
コード例 #2
0
 public function testToStringRequiredAndOptionalArguments()
 {
     $collection = new ArgumentCollection(array(new Argument(array('name' => 'arg1', 'type' => '\\ClassGeneration', 'isOptional' => true)), new Argument(array('name' => 'arg2', 'type' => 'int'))));
     $string = $collection->toString();
     $this->assertEquals('$arg2, \\ClassGeneration $arg1 = NULL', $string);
 }