PHP Class Behat\Testwork\ServiceContainer\ExtensionManager

Author: Konstantin Kudryashov ([email protected])
Mostrar archivo Open project: behat/behat Class Usage Examples

Public Methods

Method Description
__construct ( array $extensions, null | string $extensionsPath = null ) Initializes manager.
activateExtension ( string $locator ) : Behat\Testwork\ServiceContainer\Extension Activate extension by its locator.
debugInformation ( ) : array Returns array with extensions debug information.
getExtension ( string $key ) : Behat\Testwork\ServiceContainer\Extension Returns specific extension by its name.
getExtensionClasses ( ) : array Returns activated extension names.
getExtensions ( ) : Behat\Testwork\ServiceContainer\Extension[] Returns all available extensions.
initializeExtensions ( ) Initializes all activated and predefined extensions.
setExtensionsPath ( null | string $path ) Sets path to directory in which manager will try to find extension files.

Private Methods

Method Description
getFullExtensionClass ( string $locator ) : string Attempts to guess full extension class from relative.
initialize ( string $locator ) : Behat\Testwork\ServiceContainer\Extension Initializes extension by id.
instantiateExtension ( string $locator ) : Behat\Testwork\ServiceContainer\Extension Instantiates extension from its locator.
validateExtensionInstance ( Behat\Testwork\ServiceContainer\Extension $extension, string $locator ) Validates extension instance.

Method Details

__construct() public method

Initializes manager.
public __construct ( array $extensions, null | string $extensionsPath = null )
$extensions array List of default extensions
$extensionsPath null | string Base path where to search custom extension files

activateExtension() public method

Activate extension by its locator.
public activateExtension ( string $locator ) : Behat\Testwork\ServiceContainer\Extension
$locator string phar file name, php file name, class name
return Behat\Testwork\ServiceContainer\Extension

debugInformation() public method

Returns array with extensions debug information.
public debugInformation ( ) : array
return array

getExtension() public method

Returns specific extension by its name.
public getExtension ( string $key ) : Behat\Testwork\ServiceContainer\Extension
$key string
return Behat\Testwork\ServiceContainer\Extension

getExtensionClasses() public method

Returns activated extension names.
public getExtensionClasses ( ) : array
return array

getExtensions() public method

Returns all available extensions.
public getExtensions ( ) : Behat\Testwork\ServiceContainer\Extension[]
return Behat\Testwork\ServiceContainer\Extension[]

initializeExtensions() public method

Initializes all activated and predefined extensions.

setExtensionsPath() public method

Sets path to directory in which manager will try to find extension files.
public setExtensionsPath ( null | string $path )
$path null | string