Hi guys, it seems that when loading a row from the database via the orm in a phpunit test, the model will not call the appropriate observers so I am not able to test them!
EDIT: After reading this thread I think it might have something to do with unit tests not supporting the cascading file system of fuel? No idea if this is correct but it might be a clue..
Oh looks like I just fixed it! Nothing to do with cascading file system ha. Turns out I just needed to clear the cache of the model I was using. I did this by adding this method to the model:
public static function clear_cache()
{
$class = get_called_class();
unset(static::$_cached_objects[$class]);
}
and calling this from the phpunit tearDown() method so that the cache is cleared after every test.