-
Notifications
You must be signed in to change notification settings - Fork 461
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix type hints in the generator to return an absolute class name. Thi…
…s fixes a bug with namespaces.
- Loading branch information
Showing
2 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
namespace Mockery\Generator; | ||
{ | ||
class ParameterTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
/** | ||
* @test | ||
*/ | ||
public function shouldBringIteratorAggregateToHeadOfTargetListIfTraversablePresent() | ||
{ | ||
$rfp = new \ReflectionParameter(array('\TestSubjectNameSpace\TestSubject', 'foo'), 0); | ||
$parameterGenerator = new Parameter($rfp); | ||
$typeHint = $parameterGenerator->getTypeHintAsString(); | ||
|
||
$this->assertEquals('\TypeHintNameSpace\TypeHint', $typeHint); | ||
} | ||
} | ||
} | ||
|
||
namespace TypeHintNameSpace; | ||
{ | ||
class TypeHint | ||
{ | ||
} | ||
} | ||
|
||
namespace TestSubjectNameSpace; | ||
use TypeHintNameSpace\TypeHint; | ||
{ | ||
class TestSubject | ||
{ | ||
public function foo(TypeHint $param) | ||
{ | ||
} | ||
} | ||
} | ||
|
||
|