1
0
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:
dennis 2022-09-17 09:58:49 +02:00
parent b88d2890e2
commit 8ffc747349

View File

@ -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,
],
];
}
}