Class CakeTestFixture
CakeTestFixture is responsible for building and destroying tables to be used during testing.
Copyright: Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
License: MIT License
Location: Cake/TestSuite/Fixture/CakeTestFixture.php
Properties summary
- 
			$canUseMemorypublicbooleanFixture data can be stored in memory by default. When table is created for a fixture the MEMORY engine is used where possible. Set $canUseMemory to false if you don't want this. 
- 
			$createdpublicarrayList of datasources where this fixture has been created
- 
			$dbpublicobjectCakePHP's DBO driver (e.g: DboMysql).
- 
			$fieldspublicarrayFields / Schema for the fixture. This array should match the output of Model::schema() 
- 
			$namepublicstringName of the object
- 
			$primaryKeypublicstringThe primary key for the table this fixture represents.
- 
			$recordspublicarrayFixture records to be inserted.
- 
			$tablepublicstringFull Table Name
- 
			$useDbConfigpublicstringFixture Datasource
Method Summary
- 
			__construct() publicInstantiate the fixture.
- 
			create() publicRun before all tests execute, should return SQL statement to create table for this fixture could be executed successfully.
- 
			drop() publicRun after all tests executed, should return SQL statement to drop table for this fixture.
- 
			init() publicInitialize the fixture.
- 
			insert() publicRun before each tests is executed, should return a set of SQL statements to insert records for the table of this fixture could be executed successfully. 
- 
			truncate() publicTruncates the current fixture. Can be overwritten by classes extending CakeFixture to trigger other events before / after truncate. 
Method Detail
create() public ¶
create( DboSource $db )
		
Run before all tests execute, should return SQL statement to create table for this fixture could be executed successfully.
Parameters
- 
						DboSource$db
- An instance of the database object used to create the fixture table
Returns
True on success, false on failure
drop() public ¶
drop( DboSource $db )
		
Run after all tests executed, should return SQL statement to drop table for this fixture.
Parameters
- 
						DboSource$db
- An instance of the database object used to create the fixture table
Returns
True on success, false on failure
insert() public ¶
insert( DboSource $db )
		
Run before each tests is executed, should return a set of SQL statements to insert records for the table of this fixture could be executed successfully.
Parameters
- 
						DboSource$db
- An instance of the database into which the records will be inserted
Returns
on success or if there are no records to insert, or false on failure
Throws
truncate() public ¶
truncate( DboSource $db )
		
Truncates the current fixture. Can be overwritten by classes extending CakeFixture to trigger other events before / after truncate.
Parameters
- 
						DboSource$db
- A reference to a db instance
Returns
Properties detail
$canUseMemory ¶
Fixture data can be stored in memory by default. When table is created for a fixture the MEMORY engine is used where possible. Set $canUseMemory to false if you don't want this.
true
			