public function testPublicWithBodyToString() { $method = new PhpMethod('foo', array('bar', array('name' => 'demo', 'value' => 1), array('name' => 'sample', 'value' => null), new PhpFunctionParameter('deamon', true))); $method->addChild(new PhpVariable('bar', 1))->addChild('return $bar;'); $this->assertSame("public function foo(\$bar, \$demo = 1, \$sample = null, \$deamon = true)\n{\n \$bar = 1;\n return \$bar;\n}", $method->toString()); }