PHP Трейт Crud\TestSuite\Traits\CrudTestTrait

Licensed under The MIT License For full copyright and license information, please see the LICENSE.txt
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$_subject Crud\Event\Subject Reference to the final CRUD event subject after full event cycle

Открытые методы

Метод Описание
_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

Описание методов

_subscribeToEvents() публичный Метод

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
Результат void

assertEvents() публичный Метод

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
Результат void

getModel() публичный Метод

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
Результат Cake\ORM\Table

Описание свойств

$_subject защищенное свойство

Reference to the final CRUD event subject after full event cycle
protected Subject,Crud\Event $_subject
Результат Crud\Event\Subject