Not signed in (Sign In)
Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    • CommentAuthorbhembree
    • CommentTimeDec 7th 2007 edited
     
    Can someone walk me through the unit testing process. I have created a .yaml file which resides in fixtures/app/models. I have created a unit test case file in unit/app/models. In that file I have delcared:

    var $fixtures = 'yaml file name';

    there is also the the setup method at the start of the file. It doesn't look like my yaml file data is getting loaded into the database.

    I am using version 0.8 of Akelos.

    Barry
    • CommentAuthorKaste
    • CommentTimeDec 7th 2007
     

    first class BlahTest extends AkUnitTest

    so you get $this->installAndIncludeModels(...);

    this method accepts as the last argument some options.

    $options=array('populate'=>true);

    will search in fixtures/data for a yaml-file.
    You get an instance of the model at $this->ModelName.

    • CommentAuthorbhembree
    • CommentTimeDec 7th 2007
     
    Thanks Kaste,

    I've done that. Is there a command to remove the data when the test is finished running. If I run the test a second time I get collision errors. I am also getting an error that looks like it has something to do with migration as follows:

    Can't go up to version 2, already at version 2.
    • CommentAuthorKaste
    • CommentTimeDec 7th 2007
     

    installAndIncludeModels should uninstall and then reinstall the model. so when it can't go up, it probably wasn't down.

Add your comments
    Username Password
  • Format comments as