Skip to content

Commit 7753921

Browse files
committed
update tests for arument
1 parent ede1fd5 commit 7753921

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/phpDocumentor/Reflection/Php/Factory/Argument.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function create($object, StrategyContainer $strategies, Context $context
7878

7979
$default = null;
8080
if ($object->default !== null) {
81-
$default = $this->valueConverter->prettyPrintExpr($object->getValue());
81+
$default = $this->valueConverter->prettyPrintExpr($object->default);
8282
}
8383

8484
return new ArgumentDescriptor($object->name, $default, $object->byRef, $object->variadic);

tests/unit/phpDocumentor/Reflection/Php/Factory/ArgumentTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@
1313

1414
use phpDocumentor\Reflection\Php\Argument as ArgumentDescriptor;
1515
use phpDocumentor\Reflection\Php\ProjectFactoryStrategies;
16+
use phpDocumentor\Reflection\PrettyPrinter;
1617
use phpDocumentor\Reflection\Types\Context;
1718
use PhpParser\Node\Param;
1819
use Mockery as m;
20+
use PhpParser\Node\Scalar\String_;
1921

2022
/**
2123
* Class ArgumentTest
@@ -25,7 +27,7 @@ class ArgumentTest extends TestCase
2527
{
2628
protected function setUp()
2729
{
28-
$this->fixture = new Argument();
30+
$this->fixture = new Argument(new PrettyPrinter());
2931
}
3032

3133
/**
@@ -46,7 +48,7 @@ public function testCreate()
4648

4749
$argMock = m::mock(Param::class);
4850
$argMock->name = 'myArgument';
49-
$argMock->default = 'MyDefault';
51+
$argMock->default = new String_('MyDefault');
5052
$argMock->byRef = true;
5153
$argMock->variadic = true;
5254

0 commit comments

Comments
 (0)