OtherArticlesFixture
in package
implements
FixtureInterface
A fixture attached to the non-default connection that implements the interface with none of the safe-guards from TestFixture.
Table of Contents
Interfaces
- FixtureInterface
- Defines the interface that testing fixtures use.
Properties
- $table : mixed
Methods
- connection() : string
- Get the connection name this fixture should be inserted into.
- create() : bool
- Create the fixture schema/mapping/definition
- createConstraints() : bool
- drop() : bool
- Run after all tests executed, should remove the table/collection from the connection.
- dropConstraints() : bool
- insert() : StatementInterface|bool
- Run before each test is executed.
- sourceName() : string
- Get the table/collection name for this fixture.
- truncate() : bool
- Truncates the current fixture.
Properties
$table
public
mixed
$table
= 'other_articles'
Methods
connection()
Get the connection name this fixture should be inserted into.
public
connection() : string
Return values
stringcreate()
Create the fixture schema/mapping/definition
public
create(ConnectionInterface $connection) : bool
Parameters
- $connection : ConnectionInterface
-
An instance of the connection the fixture should be created on.
Return values
bool —True on success, false on failure.
createConstraints()
public
createConstraints(ConnectionInterface $connection) : bool
Parameters
- $connection : ConnectionInterface
Return values
booldrop()
Run after all tests executed, should remove the table/collection from the connection.
public
drop(ConnectionInterface $connection) : bool
Parameters
- $connection : ConnectionInterface
-
An instance of the connection the fixture should be removed from.
Return values
bool —True on success, false on failure.
dropConstraints()
public
dropConstraints(ConnectionInterface $connection) : bool
Parameters
- $connection : ConnectionInterface
Return values
boolinsert()
Run before each test is executed.
public
insert(ConnectionInterface $connection) : StatementInterface|bool
Should insert all the records into the test database.
Parameters
- $connection : ConnectionInterface
-
An instance of the connection into which the records will be inserted.
Return values
StatementInterface|bool —on success or if there are no records to insert, or false on failure.
sourceName()
Get the table/collection name for this fixture.
public
sourceName() : string
Return values
stringtruncate()
Truncates the current fixture.
public
truncate(ConnectionInterface $connection) : bool
Parameters
- $connection : ConnectionInterface
-
A reference to a db instance