Yii 1.1: fixturehelper

A console application to work with Yii's fixture
4 followers

FixtureHelper for Yii Framework

FixtureHelper is a command application lets you work with your fixtures outside testing. Currently what it does is just helping you to load you fixtures from your fixture files to your database, without the need to invoke PHPUnit.

INSTALL

Copy FixtureHelperCommand.php and place it under protected/extensions/fixtureHelper/

Edit protected/config/console.php, add the following to the config array under first dimension:

'commandMap' => array(
    'fixture' => array(
    'class'=>'application.extensions.fixtureHelper.FixtureHelperCommand',
    ),
),

Configure your database by setting up your db under components.

Add the following inside components.

'fixture'=>array(
    'class'=>'system.test.CDbFixtureManager',
),

USAGE

fixture load [--alias=folderalias] --table=tablename1[,tablename2[,...]]

PARAMETERS

  • load: Load fixtures into the database
  • --alias: The alias to the directory that contains "models" and "tests" folders. Please note that folder "models" should contain the Model class of the fixtures to be loaded. Defaults to "application". Optional for "load".
  • --tables: Name of the tables to be loaded with your defined fixtures. Name
    values are comma separated. Required for "load".

EXAMPLES

yiic fixture load --alias=application.modules.mymodule --tables=fruit,transport,country

Total 5 comments

#16165 report it
Motin at 2014/01/24 08:38am
Current repo on Github

For a working github repo, visit https://github.com/motin/yii-fixture-helper

#7736 report it
stereochrome at 2012/04/13 05:31am
db integrity and preparation of all fixtures

this extension does not deactive db consistency checking, this can result in db errors while loading a fixture. i have send a fix in github.

the github version also has code for loading all existing fixtures.

#2336 report it
sumwai at 2010/12/14 06:38am
Did a bug fix

To the first person who downloaded this extension, please replace it with the one I just uploaded.

#2335 report it
sumwai at 2010/12/14 06:28am
Requirement

Requires Yii 1.1.5

#2334 report it
sumwai at 2010/12/14 06:04am
Repo on Github

https://github.com/sumwai/fixtureHelper

Leave a comment

Please to leave your comment.

Create extension
  • Yii Version: 1.1
  • License: New BSD License
  • Developed by: sumwai
  • Category: Database
  • Votes: +10
  • Downloaded: 318 times
  • Created on: Dec 14, 2010
  • Last updated: never
  • Tags: test