Interface FixtureInterface
Defines the interface that testing fixtures use.
Method Summary
- 
          connection() publicGet the connection name this fixture should be inserted into. 
- 
          create() publicCreate the fixture schema/mapping/definition 
- 
          drop() publicRun after all tests executed, should remove the table/collection from the connection. 
- 
          insert() publicRun before each test is executed. 
- 
          sourceName() publicGet the table/collection name for this fixture. 
- 
          truncate() publicTruncates the current fixture. 
Method Detail
connection() ¶ public
connection(): stringGet the connection name this fixture should be inserted into.
Returns
stringcreate() ¶ public
create(Cake\Datasource\ConnectionInterface $db): boolCreate 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): boolRun 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): Cake\Database\StatementInterface|boolRun 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(): stringGet the table/collection name for this fixture.
Returns
stringtruncate() ¶ public
truncate(Cake\Datasource\ConnectionInterface $db): boolTruncates the current fixture.
Parameters
- 
                Cake\Datasource\ConnectionInterface$db
- A reference to a db instance 
Returns
bool