Skip to content

Commit

Permalink
Test to describe use statements being applied
Browse files Browse the repository at this point in the history
  • Loading branch information
d-claassen committed Sep 19, 2022
1 parent ab690df commit 3a6b709
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions tests/FileManipulation/ThrowsBlockAdditionTest.php
Expand Up @@ -180,6 +180,46 @@ function bar(): void {
['MissingThrowsDocblock'],
true,
],
'addThrowsAnnotationAccountsForUseStatements' => [
'<?php
namespace Foo {
use Bar\BarException;
function foo(): void {
bar();
}
/**
* @throws BarException
*/
function bar(): void {
throw new BarException();
}
}
namespace Bar {
class BarException extends \DomainException {}
}',
'<?php
namespace Foo {
use Bar\BarException;
/**
* @throws BarException
*/
function foo(): void {
bar();
}
/**
* @throws BarException
*/
function bar(): void {
throw new BarException();
}
}
namespace Bar {
class BarException extends \DomainException {}
}',
'7.4',
['MissingThrowsDocblock'],
true,
],
];
}
}

0 comments on commit 3a6b709

Please sign in to comment.