Skip to content

Commit

Permalink
Add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
NaokiTsuchiya committed Feb 21, 2022
1 parent afc7f52 commit 833f6bd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/CodeGenPhp71Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,13 @@ public function testAttribute(): void
$expected = '#[\Ray\Aop\Annotation\FakeMarker3]';
$this->assertStringContainsString($expected, $code->code);
}

public function testUseAnnotation(): void
{
$bind = new Bind();
$bind->bindInterceptors('attributed', []);
$code = $this->codeGen->generate(new ReflectionClass(FakePhp71NullableClass::class), $bind);
$expected = "use Ray\\Aop\\Annotation\\FakeMarker3;\n";
$this->assertStringContainsString($expected, $code->code);
}
}
1 change: 1 addition & 0 deletions tests/Fake/FakePhp71NullableClass.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public function useTyped(CodeGen $codeGen)
{
}

/** @FakeMarker3 */
#[FakeMarker3]
public function attributed()
{
Expand Down

0 comments on commit 833f6bd

Please sign in to comment.