1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 12:55:26 +01:00
psalm/tests/NamespaceTest.php
2017-05-26 20:05:57 -04:00

55 lines
1.4 KiB
PHP

<?php
namespace Psalm\Tests;
class NamespaceTest extends TestCase
{
use Traits\FileCheckerValidCodeParseTestTrait;
/**
* @return array
*/
public function providerFileCheckerValidCodeParse()
{
return [
'emptyNamespace' => [
'<?php
namespace A {
/** @return void */
function foo() {
}
class Bar {
}
}
namespace {
A\foo();
\A\foo();
(new A\Bar);
}',
],
'constantReference' => [
'<?php
namespace Aye\Bee {
const HELLO = "hello";
}
namespace Aye\Bee {
/** @return void */
function foo() {
echo \Aye\Bee\HELLO;
}
class Bar {
/** @return void */
public function foo() {
echo \Aye\Bee\HELLO;
}
}
}',
],
];
}
}