PHP Trait Crud\TestSuite\Traits\CrudTestTrait

Licensed under The MIT License For full copyright and license information, please see the LICENSE.txt
Datei anzeigen Open project: friendsofcake/crud

Protected Properties

Property Type Description
$_subject Crud\Event\Subject Reference to the final CRUD event subject after full event cycle

Public Methods

Method Description
_subscribeToEvents ( Controller $controller = null ) : void Subscribe to Crud.beforeRender and Crud.beforeRedirect events
assertEvents ( array $expected, array | null $actual = null ) : void Assert these CRUD events was emitted during the life cycle
getModel ( string $class, mixed $methods, string $alias, string $table ) : Table Get a "model" (Table) instance

Method Details

_subscribeToEvents() public method

This is the two 'final' emitted events after a CRUD life cycle, and thus will hold the final object It's stored in the $this->_subject property
public _subscribeToEvents ( Controller $controller = null ) : void
$controller Cake\Controller\Controller Controller
return void

assertEvents() public method

The $expected list do not need to prefix events with Crud. - this is done automatically before comparison
public assertEvents ( array $expected, array | null $actual = null ) : void
$expected array An array of CRUD events we expected to be fired
$actual array | null Can be an Event class, Crud subject or array with event names
return void

getModel() public method

Get a "model" (Table) instance
public getModel ( string $class, mixed $methods, string $alias, string $table ) : Table
$class string Full table class name
$methods mixed Methods to mock
$alias string Table alias / name
$table string Table name in the database
return Cake\ORM\Table

Property Details

$_subject protected_oe property

Reference to the final CRUD event subject after full event cycle
protected Subject,Crud\Event $_subject
return Crud\Event\Subject