Interface FixtureInterface
Defines the interface that testing fixtures use.
Method Summary
Method Detail
connection() public
connection()
Get the connection name this fixture should be inserted into.
Returns
stringcreate() public
create(\Cake\Datasource\ConnectionInterface $db)
Create the fixture schema/mapping/definition
Parameters
-
\Cake\Datasource\ConnectionInterface$db An instance of the connection the fixture should be created on.
Returns
boolTrue on success, false on failure.
drop() public
drop(\Cake\Datasource\ConnectionInterface $db)
Run after all tests executed, should remove the table/collection from the connection.
Parameters
-
\Cake\Datasource\ConnectionInterface$db An instance of the connection the fixture should be removed from.
Returns
boolTrue on success, false on failure.
insert() public
insert(\Cake\Datasource\ConnectionInterface $db)
Run before each test is executed.
Should insert all the records into the test database.
Parameters
-
\Cake\Datasource\ConnectionInterface$db An instance of the connection into which the records will be inserted.
Returns
\Cake\Database\StatementInterface|boolon success or if there are no records to insert, or false on failure.
sourceName() public
sourceName()
Get the table/collection name for this fixture.
Returns
stringtruncate() public
truncate(\Cake\Datasource\ConnectionInterface $db)
Truncates the current fixture.
Parameters
-
\Cake\Datasource\ConnectionInterface$db A reference to a db instance
Returns
bool
© 2005–present 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.
https://api.cakephp.org/4.1/interface-Cake.Datasource.FixtureInterface.html