Defines the interface that testing fixtures use.
Get the connection name this fixture should be inserted into.
Create the fixture schema/mapping/definition
Run after all tests executed, should remove the table/collection from the connection.
Run before each test is executed.
Get the table/collection name for this fixture.
Truncates the current fixture.
connection(): string
Get the connection name this fixture should be inserted into.
string
create(Cake\Datasource\ConnectionInterface $connection): bool
Create the fixture schema/mapping/definition
Cake\Datasource\ConnectionInterface
$connection An instance of the connection the fixture should be created on.
bool
drop(Cake\Datasource\ConnectionInterface $connection): bool
Run after all tests executed, should remove the table/collection from the connection.
Cake\Datasource\ConnectionInterface
$connection An instance of the connection the fixture should be removed from.
bool
insert(Cake\Datasource\ConnectionInterface $connection): Cake\Database\StatementInterface|bool
Run before each test is executed.
Should insert all the records into the test database.
Cake\Datasource\ConnectionInterface
$connection An instance of the connection into which the records will be inserted.
Cake\Database\StatementInterface|bool
sourceName(): string
Get the table/collection name for this fixture.
string
truncate(Cake\Datasource\ConnectionInterface $connection): bool
Truncates the current fixture.
Cake\Datasource\ConnectionInterface
$connection A reference to a db instance
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.4/interface-Cake.Datasource.FixtureInterface.html