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!