ProjectFactoryTest
extends MockeryTestCase
in package
Uses
ProphecyTrait
Tags
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
testCreate()
public
testCreate() : void
Tags
Return values
void —testCreateProjectFromFileWithNamespacedClass()
public
testCreateProjectFromFileWithNamespacedClass() : void
Tags
Return values
void —testCreateThrowsExceptionWhenStrategyNotFound()
public
testCreateThrowsExceptionWhenStrategyNotFound() : void
Tags
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
Return values
void —testNamespaceSpreadOverMultipleFiles()
public
testNamespaceSpreadOverMultipleFiles() : void
Tags
Return values
void —testSingleFileMultipleNamespaces()
public
testSingleFileMultipleNamespaces() : void
Tags
Return values
void —testWithNamespacedConstant()
public
testWithNamespacedConstant() : void
Tags
Return values
void —testWithNamespacedFunction()
public
testWithNamespacedFunction() : void
Tags
Return values
void —testWithNamespacedInterface()
public
testWithNamespacedInterface() : void
Tags
Return values
void —testWithNamespacedTrait()
public
testWithNamespacedTrait() : void
Tags
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
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
Return values
array<string|int, Namespace_> —Namespaces of the project