MocksClassLoader
Helper trait to test classes which use the ClassLoader (ie. extensions).
trait Winter\Storm\Support\Testing\MocksClassLoader
This trait will mock the ClassLoader so that it does not require the entire app to be instantiated.
Properties
protected $classLoader : ClassLoader
Mocked ClassLoader instance
Methods
protected mockClassLoader (string $class) : mixed
Mocks the getClassLoader
method of a class that uses the Extendable
trait.
The mock will use the class loader from this trait.
Parameters
Property | Type | Description |
---|---|---|
$class | string |
string
|
Returns
mixed
protected
registerMockClassLoader (string $basePath = null
, string $manifestPath = null
)
: void
Registers a mock class loader in the autoload stack.
Parameters
Property | Type | Description |
---|---|---|
$basePath | string |
string
|
$manifestPath | string |
string
|
Returns
void
← Previous page
Winter\Storm\Support\Testing\Fakes\MailFake
Next page →
Winter\Storm\Support\Traits\Emitter
Copyright © 2024 Winter CMS