PHP 클래스 Codeception\Module\Laravel5

Please try it and leave your feedback. The module is based on the Laravel 4 module by Davert. ## Demo project ## Status * Maintainer: **Jan-Henk Gerritsen** * Stability: **dev** * Contact: [email protected] ## Example modules: enabled: - Laravel5 ## Config * cleanup: boolean, default true - all db queries will be run in transaction, which will be rolled back at the end of test. * environment_file: string, default .env - The .env file to load for the tests. * bootstrap: string, default bootstrap/app.php - Relative path to app.php config file. * root: string, default - Root path of our application. * packages: string, default workbench - Root path of application packages (if any). ## API * app - Illuminate\Foundation\Application instance * client - BrowserKit` client ## Parts * ORM - include only haveRecord/grabRecord/seeRecord/dontSeeRecord actions
상속: extends Codeception\Lib\Framework, implements Codeception\Lib\Interfaces\ActiveRecord, implements Codeception\Lib\Interfaces\PartedModule
파일 보기 프로젝트 열기: janhenkgerritsen/codeception-laravel5 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$app Illuminate\Foundation\Application

보호된 프로퍼티들

프로퍼티 타입 설명
$config array

공개 메소드들

메소드 설명
__construct ( $config = null ) Constructor.
_after ( Codeception\TestCase $test ) After hook.
_afterStep ( Codeception\Step $step ) After step hook.
_before ( Codeception\TestCase $test ) Before hook.
_initialize ( ) Initialize hook.
amLoggedAs ( Illuminate\Contracts\Auth\User | array $user, string $driver = null ) : void Set the currently logged in user for the application.
amOnAction ( $action, array $params = [] ) Opens web page by action name
amOnRoute ( $route, array $params = [] ) Opens web page using route name and parameters.
dontSeeAuthentication ( ) Check that user is not authenticated
dontSeeRecord ( $model, array $attributes = [] ) Checks that record does not exist in database.
getApplication ( ) : Illuminate\Foundation\Application Provides access the Laravel application object.
grabRecord ( $model, array $attributes = [] ) : mixed Retrieves record from database
grabService ( string $class ) : mixed Return an instance of a class from the IoC Container.
haveRecord ( $model, array $attributes = [] ) : mixed Inserts record into the database.
logout ( ) Logs user out
seeAuthentication ( ) Checks that user is authenticated
seeCurrentActionIs ( $action, array $params = [] ) Checks that current url matches action
seeCurrentRouteIs ( $route, array $params = [] ) Checks that current url matches route
seeFormErrorMessage ( string $key, string $errorMessage ) Assert that specific form error message is set in the view.
seeFormErrorMessages ( array $bindings ) Assert that specific form error messages are set in the view.
seeFormHasErrors ( ) : boolean Assert that the form errors are bound to the View.
seeInSession ( string | array $key, mixed $value = null ) : void Assert that the session has a given list of values.
seeRecord ( $model, array $attributes = [] ) Checks that record exists in database.
seeSessionHasValues ( array $bindings ) : void Assert that the session has a given list of values.

보호된 메소드들

메소드 설명
actionWithNamespace ( string $action ) : string Normalize an action to full namespaced action.
bootApplication ( ) : Illuminate\Foundation\Application Boot the Laravel application object.
findRecord ( $model, array $attributes = [] ) : mixed
getRootControllerNamespace ( ) : string Get the root controller namespace for the application.
initializeLaravel ( ) Initialize the Laravel framework.
revertErrorHandler ( ) Revert back to the Codeception error handler, becauses Laravel registers it's own error handler.

메소드 상세

__construct() 공개 메소드

Constructor.
public __construct ( $config = null )
$config

_after() 공개 메소드

After hook.
public _after ( Codeception\TestCase $test )
$test Codeception\TestCase

_afterStep() 공개 메소드

After step hook.
public _afterStep ( Codeception\Step $step )
$step Codeception\Step

_before() 공개 메소드

Before hook.
public _before ( Codeception\TestCase $test )
$test Codeception\TestCase

_initialize() 공개 메소드

Initialize hook.
public _initialize ( )

actionWithNamespace() 보호된 메소드

Normalize an action to full namespaced action.
protected actionWithNamespace ( string $action ) : string
$action string
리턴 string

amLoggedAs() 공개 메소드

Takes either an object that implements the User interface or an array of credentials.
public amLoggedAs ( Illuminate\Contracts\Auth\User | array $user, string $driver = null ) : void
$user Illuminate\Contracts\Auth\User | array
$driver string
리턴 void

amOnAction() 공개 메소드

php amOnAction('PostsController@index'); ?>
public amOnAction ( $action, array $params = [] )
$action
$params array

amOnRoute() 공개 메소드

php amOnRoute('posts.create'); ?>
public amOnRoute ( $route, array $params = [] )
$route
$params array

bootApplication() 보호된 메소드

Boot the Laravel application object.
protected bootApplication ( ) : Illuminate\Foundation\Application
리턴 Illuminate\Foundation\Application

dontSeeAuthentication() 공개 메소드

Check that user is not authenticated

dontSeeRecord() 공개 메소드

php dontSeeRecord('users', array('name' => 'davert')); ?>
public dontSeeRecord ( $model, array $attributes = [] )
$model
$attributes array

findRecord() 보호된 메소드

protected findRecord ( $model, array $attributes = [] ) : mixed
$model
$attributes array
리턴 mixed

getApplication() 공개 메소드

Provides access the Laravel application object.
public getApplication ( ) : Illuminate\Foundation\Application
리턴 Illuminate\Foundation\Application

getRootControllerNamespace() 보호된 메소드

Get the root controller namespace for the application.
protected getRootControllerNamespace ( ) : string
리턴 string

grabRecord() 공개 메소드

php grabRecord('users', array('name' => 'davert')); ?>
public grabRecord ( $model, array $attributes = [] ) : mixed
$model
$attributes array
리턴 mixed

grabService() 공개 메소드

(http://laravel.com/docs/ioc) Example php grabService('foo'); Will return an instance of FooBar, also works for singletons. ?>
public grabService ( string $class ) : mixed
$class string
리턴 mixed

haveRecord() 공개 메소드

php haveRecord('users', array('name' => 'Davert')); ?>
public haveRecord ( $model, array $attributes = [] ) : mixed
$model
$attributes array
리턴 mixed

initializeLaravel() 보호된 메소드

Initialize the Laravel framework.
protected initializeLaravel ( )

logout() 공개 메소드

Logs user out
public logout ( )

revertErrorHandler() 보호된 메소드

Revert back to the Codeception error handler, becauses Laravel registers it's own error handler.
protected revertErrorHandler ( )

seeAuthentication() 공개 메소드

Checks that user is authenticated
public seeAuthentication ( )

seeCurrentActionIs() 공개 메소드

php seeCurrentActionIs('PostsController@index'); ?>
public seeCurrentActionIs ( $action, array $params = [] )
$action
$params array

seeCurrentRouteIs() 공개 메소드

php seeCurrentRouteIs('posts.index'); ?>
public seeCurrentRouteIs ( $route, array $params = [] )
$route
$params array

seeFormErrorMessage() 공개 메소드

Useful for validation messages and generally messages array e.g. return Redirect::to('register')->withErrors($validator); Example of Usage php seeFormErrorMessage('username', 'Invalid Username'); ?>
public seeFormErrorMessage ( string $key, string $errorMessage )
$key string
$errorMessage string

seeFormErrorMessages() 공개 메소드

Useful for validation messages and generally messages array e.g. return Redirect::to('register')->withErrors($validator); Example of Usage php seeFormErrorMessages(array('username'=>'Invalid Username')); ?>
public seeFormErrorMessages ( array $bindings )
$bindings array

seeFormHasErrors() 공개 메소드

Assert that the form errors are bound to the View.
public seeFormHasErrors ( ) : boolean
리턴 boolean

seeInSession() 공개 메소드

Assert that the session has a given list of values.
public seeInSession ( string | array $key, mixed $value = null ) : void
$key string | array
$value mixed
리턴 void

seeRecord() 공개 메소드

php $I->seeRecord('users', array('name' => 'davert'));
public seeRecord ( $model, array $attributes = [] )
$model
$attributes array

seeSessionHasValues() 공개 메소드

Assert that the session has a given list of values.
public seeSessionHasValues ( array $bindings ) : void
$bindings array
리턴 void

프로퍼티 상세

$app 공개적으로 프로퍼티

public Application,Illuminate\Foundation $app
리턴 Illuminate\Foundation\Application

$config 보호되어 있는 프로퍼티

protected array $config
리턴 array