Documentation

ProjectFactoryTest extends MockeryTestCase
in package
Uses ProphecyTrait

Tags
uses
Project
uses
Namespace_
uses
Class_
uses
Interface_
uses
Trait_
uses
Constant
uses
File
uses
Function_
uses
ProjectFactoryStrategies
uses
Visibility
coversDefaultClass

\phpDocumentor\Reflection\Php\ProjectFactory

covers
covers

::

Table of Contents

testCreate()  : void
testCreateProjectFromFileWithNamespacedClass()  : void
testCreateThrowsExceptionWhenStrategyNotFound()  : void
testCreatingAnInstanceInstantiatesItWithTheRecommendedStrategies()  : void
Tests whether a factory can be instantiated using recommended factories.
testNamespaceSpreadOverMultipleFiles()  : void
testSingleFileMultipleNamespaces()  : void
testWithNamespacedConstant()  : void
testWithNamespacedFunction()  : void
testWithNamespacedInterface()  : void
testWithNamespacedTrait()  : void
fetchNamespacesFromMultipleFiles()  : array<string|int, Namespace_>
Uses the ProjectFactory to create a Project and returns the namespaces created by the factory.
fetchNamespacesFromSingleFile()  : array<string|int, Namespace_>
Uses the ProjectFactory to create a Project and returns the namespaces created by the factory.

Methods

testCreateProjectFromFileWithNamespacedClass()

public testCreateProjectFromFileWithNamespacedClass() : void
Tags
covers
Return values
void

testCreateThrowsExceptionWhenStrategyNotFound()

public testCreateThrowsExceptionWhenStrategyNotFound() : void
Tags
covers
Return values
void

testCreatingAnInstanceInstantiatesItWithTheRecommendedStrategies()

Tests whether a factory can be instantiated using recommended factories.

public testCreatingAnInstanceInstantiatesItWithTheRecommendedStrategies() : void

This test is unable to test which exact factories are instantiated because that is not exposed by the factory. Even using assertEquals to do a regression test against a pre-populated factory does not work because there is a piece of randomness inside one of the properties; causing the tests to fail when you try to do it like that.

Tags
uses
ChainFactory
uses
Property
uses
Argument
uses
Method
uses
Class_
uses
Interface_
uses
ClassConstant
uses
Define
uses
GlobalConstant
uses
Argument
uses
Trait_
uses
DocBlock
uses
File
uses
NodesFactory
covers
Return values
void

testNamespaceSpreadOverMultipleFiles()

public testNamespaceSpreadOverMultipleFiles() : void
Tags
covers
Return values
void

testSingleFileMultipleNamespaces()

public testSingleFileMultipleNamespaces() : void
Tags
covers
Return values
void

testWithNamespacedConstant()

public testWithNamespacedConstant() : void
Tags
covers
Return values
void

testWithNamespacedFunction()

public testWithNamespacedFunction() : void
Tags
covers
Return values
void

testWithNamespacedInterface()

public testWithNamespacedInterface() : void
Tags
covers
Return values
void

testWithNamespacedTrait()

public testWithNamespacedTrait() : void
Tags
covers
Return values
void

fetchNamespacesFromMultipleFiles()

Uses the ProjectFactory to create a Project and returns the namespaces created by the factory.

private fetchNamespacesFromMultipleFiles(array<string|int, File$files) : array<string|int, Namespace_>
Parameters
$files : array<string|int, File>
Tags
throws
Exception
Return values
array<string|int, Namespace_>

Namespaces of the project

fetchNamespacesFromSingleFile()

Uses the ProjectFactory to create a Project and returns the namespaces created by the factory.

private fetchNamespacesFromSingleFile(File $file) : array<string|int, Namespace_>
Parameters
$file : File
Tags
throws
Exception
Return values
array<string|int, Namespace_>

Namespaces of the project

Search results