PHP Class PhpSpec\Laravel\Util\Laravel

Show file Open project: benconstable/phpspec-laravel Class Usage Examples

Protected Properties

Property Type Description
$app Illuminate\Foundation\Application The Illuminate application instance.
$appPath string Path to the root of the Laravel application.
$env string The Laravel testing environment.

Public Methods

Method Description
__construct ( string $env, string $appPath ) Constructor.
getAppPath ( ) : string Get the root Laravel application path.
getEnv ( ) : string Get the Laravel application environment being used.
refreshApplication ( Illuminate\Foundation\Application | null $app = null ) : void Refresh the application instance.

Protected Methods

Method Description
createApplication ( ) : Illuminate\Foundation\Application Creates a Laravel application.

Method Details

__construct() public method

Constructor.
public __construct ( string $env, string $appPath )
$env string Laravel testing environment. 'testing' by default
$appPath string Path to the Laravel bootstrap dir

createApplication() protected method

Creates a Laravel application.
protected createApplication ( ) : Illuminate\Foundation\Application
return Illuminate\Foundation\Application

getAppPath() public method

Get the root Laravel application path.
public getAppPath ( ) : string
return string Root laravel app path

getEnv() public method

Get the Laravel application environment being used.
public getEnv ( ) : string
return string Environment name

refreshApplication() public method

Refresh the application instance.
public refreshApplication ( Illuminate\Foundation\Application | null $app = null ) : void
$app Illuminate\Foundation\Application | null Optionally provide your own unbooted Laravel Application instance. This parameter can largely be ignored and is used just for unit testing
return void

Property Details

$app protected property

The Illuminate application instance.
protected Application,Illuminate\Foundation $app
return Illuminate\Foundation\Application

$appPath protected property

Path to the root of the Laravel application.
protected string $appPath
return string

$env protected property

The Laravel testing environment.
protected string $env
return string