Пример #1
0
    /** @test */
    public function itShouldWriteLongDesc()
    {
        $method = new Method('setFoo');
        $method->addParam('string', 'bar', 'nonesense');
        $method->addArgument(new Argument('foo', 'string'));
        $expected = <<<PHP
    /**
     * setFoo
     *
     * @param string \$bar nonesense
     * @param string \$foo
     *
     * @return void
     */
    public function setFoo(\$foo)
    {
    }
PHP;
        $this->assertSame($expected, $method->generate());
    }
Пример #2
0
 /** @test */
 public function itShouldHaveMethods()
 {
     $cg = $this->newObw('Foo', 'Acme');
     $cg->noAutoGenerateTag();
     $cg->setMethods([$m = new Method('__construct')]);
     $m->addArgument(new Argument('bar', 'Bar'));
     $c = $this->getContents('class.4.php');
     $this->assertEquals($c = $this->getContents('class.4.php'), $cg->generate());
 }