|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* This file is part of phpDocumentor. |
|
4
|
|
|
* |
|
5
|
|
|
* For the full copyright and license information, please view the LICENSE |
|
6
|
|
|
* file that was distributed with this source code. |
|
7
|
|
|
* |
|
8
|
|
|
* @copyright 2010-2015 Mike van Riel<[email protected]> |
|
9
|
|
|
* @license http://www.opensource.org/licenses/mit-license.php MIT |
|
10
|
|
|
* @link http://phpdoc.org |
|
11
|
|
|
*/ |
|
12
|
|
|
|
|
13
|
|
|
namespace phpDocumentor\Reflection; |
|
14
|
|
|
|
|
15
|
|
|
use Mockery as m; |
|
16
|
|
|
use phpDocumentor\Reflection\File\LocalFile; |
|
17
|
|
|
use phpDocumentor\Reflection\Php\Factory\Argument; |
|
18
|
|
|
use phpDocumentor\Reflection\Php\Factory\Class_; |
|
19
|
|
|
use phpDocumentor\Reflection\Php\Factory\Constant; |
|
20
|
|
|
use phpDocumentor\Reflection\Php\Factory\DocBlock as DocBlockStrategy; |
|
21
|
|
|
use phpDocumentor\Reflection\Php\Factory\File; |
|
22
|
|
|
use phpDocumentor\Reflection\Php\NodesFactory; |
|
23
|
|
|
use phpDocumentor\Reflection\Php\Factory\Function_; |
|
24
|
|
|
use phpDocumentor\Reflection\Php\Factory\Interface_; |
|
25
|
|
|
use phpDocumentor\Reflection\Php\Factory\Method; |
|
26
|
|
|
use phpDocumentor\Reflection\Php\Factory\Property; |
|
27
|
|
|
use phpDocumentor\Reflection\Php\Factory\Trait_; |
|
28
|
|
|
use phpDocumentor\Reflection\Php\ProjectFactory; |
|
29
|
|
|
use PHPUnit\Framework\TestCase; |
|
30
|
|
|
|
|
31
|
|
|
/** |
|
32
|
|
|
* Intergration tests to check the correct working of processing a namespace into a project. |
|
33
|
|
|
* |
|
34
|
|
|
* @coversNothing |
|
35
|
|
|
*/ |
|
36
|
|
|
class ProjectNamespaceTest extends TestCase |
|
37
|
|
|
{ |
|
38
|
|
|
/** |
|
39
|
|
|
* @var ProjectFactory |
|
40
|
|
|
*/ |
|
41
|
|
|
private $fixture; |
|
42
|
|
|
|
|
43
|
|
|
/** |
|
44
|
|
|
* |
|
45
|
|
|
*/ |
|
46
|
|
|
protected function setUp() |
|
47
|
|
|
{ |
|
48
|
|
|
$this->fixture = $this->fixture = ProjectFactory::createInstance(); |
|
49
|
|
|
} |
|
50
|
|
|
|
|
51
|
|
|
protected function tearDown() |
|
52
|
|
|
{ |
|
53
|
|
|
m::close(); |
|
54
|
|
|
} |
|
55
|
|
|
|
|
56
|
|
|
public function testWithNamespacedClass() |
|
57
|
|
|
{ |
|
58
|
|
|
$fileName = __DIR__ . '/project/Luigi/Pizza.php'; |
|
59
|
|
|
$project = $this->fixture->create('My Project', [ |
|
60
|
|
|
new LocalFile($fileName) |
|
61
|
|
|
]); |
|
62
|
|
|
|
|
63
|
|
|
$this->assertArrayHasKey($fileName, $project->getFiles()); |
|
64
|
|
|
$this->assertArrayHasKey('\\Luigi', $project->getNamespaces()); |
|
65
|
|
|
$this->assertEquals( |
|
66
|
|
|
['\\Luigi\\Pizza' => new Fqsen('\\Luigi\\Pizza')], |
|
67
|
|
|
$project->getNamespaces()['\\Luigi']->getClasses() |
|
68
|
|
|
); |
|
69
|
|
|
} |
|
70
|
|
|
} |
|
71
|
|
|
|