BootstrapShimGenerator
Generates deterministic PHPUnit bootstrap shims for working-directory test runs.
Description
The generated shim MUST load the consumer bootstrap first and MAY then load the active DevTools package autoloader so packaged PHPUnit configuration can still resolve DevTools-owned extension classes during global installations.
Properties
Methods
Writes a deterministic bootstrap shim under the resolved cache directory.
Escapes a runtime string as a valid PHP string literal.
Renders the bootstrap shim contents.
private
FilesystemInterface
$filesystem
public
__construct(FilesystemInterface
$filesystem) : mixed
Parameters
Description
the filesystem used to persist generated shims
Writes a deterministic bootstrap shim under the resolved cache directory.
public
generate(
string
$projectBootstrap,
string
$cacheDirectory) : string
Parameters
$projectBootstrap
:
string
Description
the consumer-project bootstrap path
$cacheDirectory
:
string
Description
the cache directory where the shim SHOULD be stored
Return values
Description
the generated bootstrap shim path
Escapes a runtime string as a valid PHP string literal.
private
export(
string
$value) : string
Parameters
$value
:
string
Description
the value to render as PHP code
Return values
Description
the exported PHP literal
Renders the bootstrap shim contents.
private
render(
string
$projectBootstrap) : string
Parameters
$projectBootstrap
:
string
Description
the consumer-project bootstrap path
Return values
Description
the bootstrap shim source code