mirror of
https://github.com/danog/psalm.git
synced 2024-11-27 04:45:20 +01:00
Add test to document cross namespace behaviour
This commit is contained in:
parent
b88d2890e2
commit
8ffc747349
@ -142,6 +142,44 @@ class ThrowsBlockAdditionTest extends FileManipulationTestCase
|
||||
['MissingThrowsDocblock'],
|
||||
true,
|
||||
],
|
||||
'addThrowsAnnotationToFunctionFromFunctionFromOtherNamespace' => [
|
||||
'<?php
|
||||
namespace Foo {
|
||||
function foo(): void {
|
||||
\Bar\bar();
|
||||
}
|
||||
}
|
||||
namespace Bar {
|
||||
class BarException extends \DomainException {}
|
||||
/**
|
||||
* @throws BarException
|
||||
*/
|
||||
function bar(): void {
|
||||
throw new BarException();
|
||||
}
|
||||
}',
|
||||
'<?php
|
||||
namespace Foo {
|
||||
/**
|
||||
* @throws \Bar\BarException
|
||||
*/
|
||||
function foo(): void {
|
||||
\Bar\bar();
|
||||
}
|
||||
}
|
||||
namespace Bar {
|
||||
class BarException extends \DomainException {}
|
||||
/**
|
||||
* @throws BarException
|
||||
*/
|
||||
function bar(): void {
|
||||
throw new BarException();
|
||||
}
|
||||
}',
|
||||
'7.4',
|
||||
['MissingThrowsDocblock'],
|
||||
true,
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user