Pluf_Test_Fixture Class Reference

List of all members.

Static Public Member Functions

static loadFile ($file)
static load ($json, $deserialize=true)
static dump ($model, $serialize=true)
static prepare ($model)


Detailed Description

The fixture class is used to prepopulate your database with data.

Load a fixture file in the database: array = Pluf_Test_Fixture::load('fixturefile.json');

Dump the data of a model as a fixture string: $json = Pluf_Test_Fixture::dump('YourApp_Model'); // the full table $json = Pluf_Test_Fixture::dump($model); // one given model


Member Function Documentation

static Pluf_Test_Fixture::loadFile ( file  )  [static]

static Pluf_Test_Fixture::load ( json,
deserialize = true 
) [static]

static Pluf_Test_Fixture::dump ( model,
serialize = true 
) [static]

Given a model or model name, dump the content.

If the object is given, only this single object is dumped else the complete table.

Parameters:
mixed Model object or model name
bool Serialize as JSON (true)
Returns:
mixed Array or JSON string

static Pluf_Test_Fixture::prepare ( model  )  [static]

Return an array, ready to be serialized as json.


The documentation for this class was generated from the following file:

Generated on Wed Feb 3 15:44:52 2010 for Pluf by  doxygen