Merge pull request #1407 from aivus/patch-1
Add return to removeMethodTemplate
This commit is contained in:
commit
28cebeca1c
@ -279,10 +279,12 @@ public function <methodName>(<methodTypeHint>$<variableName>)
|
|||||||
* <description>
|
* <description>
|
||||||
*
|
*
|
||||||
* @param <variableType> $<variableName>
|
* @param <variableType> $<variableName>
|
||||||
|
*
|
||||||
|
* @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
|
||||||
*/
|
*/
|
||||||
public function <methodName>(<methodTypeHint>$<variableName>)
|
public function <methodName>(<methodTypeHint>$<variableName>)
|
||||||
{
|
{
|
||||||
<spaces>$this-><fieldName>->removeElement($<variableName>);
|
<spaces>return $this-><fieldName>->removeElement($<variableName>);
|
||||||
}';
|
}';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -262,10 +262,10 @@ class EntityGeneratorTest extends OrmTestCase
|
|||||||
$this->assertEquals($author, $book->getAuthor());
|
$this->assertEquals($author, $book->getAuthor());
|
||||||
|
|
||||||
$comment = new EntityGeneratorComment();
|
$comment = new EntityGeneratorComment();
|
||||||
$book->addComment($comment);
|
$this->assertInstanceOf($metadata->name, $book->addComment($comment));
|
||||||
$this->assertInstanceOf('Doctrine\Common\Collections\ArrayCollection', $book->getComments());
|
$this->assertInstanceOf('Doctrine\Common\Collections\ArrayCollection', $book->getComments());
|
||||||
$this->assertEquals(new \Doctrine\Common\Collections\ArrayCollection(array($comment)), $book->getComments());
|
$this->assertEquals(new \Doctrine\Common\Collections\ArrayCollection(array($comment)), $book->getComments());
|
||||||
$book->removeComment($comment);
|
$this->assertInternalType('boolean', $book->removeComment($comment));
|
||||||
$this->assertEquals(new \Doctrine\Common\Collections\ArrayCollection(array()), $book->getComments());
|
$this->assertEquals(new \Doctrine\Common\Collections\ArrayCollection(array()), $book->getComments());
|
||||||
|
|
||||||
$this->newInstance($isbnMetadata);
|
$this->newInstance($isbnMetadata);
|
||||||
@ -362,7 +362,9 @@ class EntityGeneratorTest extends OrmTestCase
|
|||||||
$this->assertPhpDocVarType('\Doctrine\Common\Collections\Collection', new \ReflectionProperty($book, 'comments'));
|
$this->assertPhpDocVarType('\Doctrine\Common\Collections\Collection', new \ReflectionProperty($book, 'comments'));
|
||||||
$this->assertPhpDocReturnType('\Doctrine\Common\Collections\Collection', new \ReflectionMethod($book, 'getComments'));
|
$this->assertPhpDocReturnType('\Doctrine\Common\Collections\Collection', new \ReflectionMethod($book, 'getComments'));
|
||||||
$this->assertPhpDocParamType('\Doctrine\Tests\ORM\Tools\EntityGeneratorComment', new \ReflectionMethod($book, 'addComment'));
|
$this->assertPhpDocParamType('\Doctrine\Tests\ORM\Tools\EntityGeneratorComment', new \ReflectionMethod($book, 'addComment'));
|
||||||
|
$this->assertPhpDocReturnType('EntityGeneratorBook', new \ReflectionMethod($book, 'addComment'));
|
||||||
$this->assertPhpDocParamType('\Doctrine\Tests\ORM\Tools\EntityGeneratorComment', new \ReflectionMethod($book, 'removeComment'));
|
$this->assertPhpDocParamType('\Doctrine\Tests\ORM\Tools\EntityGeneratorComment', new \ReflectionMethod($book, 'removeComment'));
|
||||||
|
$this->assertPhpDocReturnType('boolean', new \ReflectionMethod($book, 'removeComment'));
|
||||||
|
|
||||||
$this->assertPhpDocVarType('\Doctrine\Tests\ORM\Tools\EntityGeneratorAuthor', new \ReflectionProperty($book, 'author'));
|
$this->assertPhpDocVarType('\Doctrine\Tests\ORM\Tools\EntityGeneratorAuthor', new \ReflectionProperty($book, 'author'));
|
||||||
$this->assertPhpDocReturnType('\Doctrine\Tests\ORM\Tools\EntityGeneratorAuthor', new \ReflectionMethod($book, 'getAuthor'));
|
$this->assertPhpDocReturnType('\Doctrine\Tests\ORM\Tools\EntityGeneratorAuthor', new \ReflectionMethod($book, 'getAuthor'));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user