Cake TestFixture is responsible for building and destroying tables to be used during testing.
__construct( )
Instantiate the fixture.
Cake\Core\Exception\Exception
_getRecords( )
Converts the internal records into data used to generate a query.
array
_schemaFromFields( )
Build the fixtures table schema from the fields property.
_schemaFromImport( )
Build fixture schema from a table in another datasource.
Cake\Core\Exception\Exception
connection( )
Get the connection name this fixture should be inserted into.
string
Cake\Datasource\FixtureInterface::connection()
create( Cake\Datasource\ConnectionInterface $db )
Create the fixture schema/mapping/definition
Cake\Datasource\ConnectionInterface
$db
boolean
Cake\Datasource\FixtureInterface::create()
createConstraints( Cake\Datasource\ConnectionInterface $db )
Build and execute SQL queries necessary to create the constraints for the fixture
Cake\Datasource\ConnectionInterface
$db
boolean
Cake\Datasource\FixtureInterface::createConstraints()
drop( Cake\Datasource\ConnectionInterface $db )
Run after all tests executed, should remove the table/collection from the connection.
Cake\Datasource\ConnectionInterface
$db
boolean
Cake\Datasource\FixtureInterface::drop()
dropConstraints( Cake\Datasource\ConnectionInterface $db )
Build and execute SQL queries necessary to drop the constraints for the fixture
Cake\Datasource\ConnectionInterface
$db
boolean
Cake\Datasource\FixtureInterface::dropConstraints()
init( )
Initialize the fixture.
Cake\ORM\Exception\MissingTableClassException
insert( Cake\Datasource\ConnectionInterface $db )
Run before each test is executed.
Cake\Datasource\ConnectionInterface
$db
boolean
Cake\Datasource\FixtureInterface::insert()
schema( Cake\Database\Schema\Table $schema null )
Get/Set the Cake\Database\Schema\Table instance used by this fixture.
Cake\Database\Schema\Table
$schema
optional null Cake\Database\Schema\Table|null
sourceName( )
Get the table/collection name for this fixture.
string
Cake\Datasource\FixtureInterface::sourceName()
truncate( Cake\Datasource\ConnectionInterface $db )
Truncates the current fixture.
Cake\Datasource\ConnectionInterface
$db
boolean
Cake\Datasource\FixtureInterface::truncate()
© 2005–2016 The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
http://api.cakephp.org/3.1/class-Cake.TestSuite.Fixture.TestFixture.html