update v 1.0.7.5
This commit is contained in:
@@ -76,6 +76,16 @@ class FunctionTest extends \PHPUnit_Framework_TestCase
|
||||
)), $node);
|
||||
}
|
||||
|
||||
public function testReturnType() {
|
||||
$node = $this->createFunctionBuilder('test')
|
||||
->setReturnType('bool')
|
||||
->getNode();
|
||||
|
||||
$this->assertEquals(new Stmt\Function_('test', array(
|
||||
'returnType' => 'bool'
|
||||
), array()), $node);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \LogicException
|
||||
* @expectedExceptionMessage Expected parameter node, got "Name"
|
||||
|
||||
@@ -120,6 +120,15 @@ class MethodTest extends \PHPUnit_Framework_TestCase
|
||||
)), $node);
|
||||
}
|
||||
|
||||
public function testReturnType() {
|
||||
$node = $this->createMethodBuilder('test')
|
||||
->setReturnType('bool')
|
||||
->getNode();
|
||||
$this->assertEquals(new Stmt\ClassMethod('test', array(
|
||||
'returnType' => 'bool'
|
||||
), array()), $node);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \LogicException
|
||||
* @expectedExceptionMessage Cannot add statements to an abstract method
|
||||
|
||||
Reference in New Issue
Block a user