Expose canUseMemory

This lets Fixture be used to create an actual persistent table with InnoDB engine instead of MEMORY.
This commit is contained in:
Harold Putman 2014-03-28 09:20:48 -04:00
parent c17cc39f08
commit 522b5048f8

View file

@ -81,6 +81,15 @@ class CakeTestFixture {
*/ */
public $primaryKey = null; public $primaryKey = null;
/**
* 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.
*
* @var array
*/
public $canUseMemory = true;
/** /**
* Instantiate the fixture. * Instantiate the fixture.
* *
@ -199,7 +208,7 @@ class CakeTestFixture {
} }
if (empty($this->fields['tableParameters']['engine'])) { if (empty($this->fields['tableParameters']['engine'])) {
$canUseMemory = true; $canUseMemory = $this->canUseMemory;
foreach ($this->fields as $args) { foreach ($this->fields as $args) {
if (is_string($args)) { if (is_string($args)) {