BootstrapShimGenerator

Class
Read only: Yes Final: Yes

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.

Table of Contents

Properties

Methods

 : mixed
generate()

Writes a deterministic bootstrap shim under the resolved cache directory.

 : string
export()

Escapes a runtime string as a valid PHP string literal.

 : string
render()

Renders the bootstrap shim contents.

 : string
Properties
Methods

generate()

Public

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
string

Description

the generated bootstrap shim path

export()

Private

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
string

Description

the exported PHP literal

render()

Private

Renders the bootstrap shim contents.

private render( string  $projectBootstrap) : string
Parameters
$projectBootstrap : string

Description

the consumer-project bootstrap path

Return values
string

Description

the bootstrap shim source code