1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 04:45:20 +01:00
psalm/tests/NamespaceTest.php

55 lines
1.4 KiB
PHP
Raw Normal View History

2017-01-13 19:48:58 +01:00
<?php
namespace Psalm\Tests;
class NamespaceTest extends TestCase
2017-01-13 19:48:58 +01:00
{
use Traits\FileCheckerValidCodeParseTestTrait;
2017-01-13 19:48:58 +01:00
2017-01-13 20:07:23 +01:00
/**
* @return array
2017-01-13 20:07:23 +01:00
*/
public function providerFileCheckerValidCodeParse()
2017-01-13 19:48:58 +01:00
{
return [
'emptyNamespace' => [
'<?php
namespace A {
/** @return void */
function foo() {
}
class Bar {
}
}
namespace {
A\foo();
\A\foo();
(new A\Bar);
2017-05-27 02:05:57 +02:00
}',
],
'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;
}
}
2017-05-27 02:05:57 +02:00
}',
],
];
}
2017-01-13 19:48:58 +01:00
}