Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Unit Test w/ Migration
  • I wrote some test case with ORM.
    and I got a error 'Cannot redeclare class XXXXX'. I wrote a test case as follow. class Some_Test extends Test_Case
    {
    public static function setUpBeforeClass() {
    \Migrate::version(n, xxx, xxx);
    } ... some test public static function tearDownAfterClass() {
    \Migrate::version(n, xxx, xxx);
    }
    } this code will raise error 'Cannot redeclare class Some_Test'
    when I execute 'php oil test' because class Migrate use
    'include' for loading migration classes. I'm able to solve this problem if I rewrite 'include' to 'require_once'.
    Let me know if you have more better way to solve this problem.
    I'd like to know more SMART WAY. How do you write unit test with ORM? I'm interesting with it.
  • There are some area's in FuelPHP that don't follow the cascading file system rules, and can not be loaded by the autoloader. Migrations and Tasks are examples of those. There is an issue open in the bugtracker to correct that, but probably not before v2.0 since it would break existing applications.
  • Thanx for replying. I understood that I should wait v2.0. and I'll rewrite the original source code to solve this problem this time.
    But I love this framework anyway!

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion