/** * @test * @covers Cocur\Ea\MethodFactory::generate() * @covers Cocur\Ea\MethodFactory::generateArguments() * @covers Cocur\Ea\MethodFactory::generateArgument() */ public function generateReturnsCodeOfMethodWithArguments() { $m = new MethodFactory('foo'); $m->addArgument('bar'); $m->addArgument('baz', 'array'); $m->addArgument('qoo', null, 'qoz'); $m->addArgument('boo', null, null); $this->assertSame('function foo($bar, array $baz, $qoo = \'qoz\', $boo = null) {}', $m->generate()); }