Hello,

What's the general way of writing unit tests in Agavi?  I want to get
into the habit of writing tests while writing my code.

I've examined the "test" folder in the Agavi source, but whenever I
instantiate a class, I get a "class not found" error.  How can I
automagically include my classes?

Currently, I'm doing this in order to include the classes:

$app_dir = AgaviConfig::get('core.app_dir');
require_once "$app_dir/modules/FooBar/lib/action/FooBarBaseAction.class.php";

class FooBarBaseActionTest extends AgaviPhpUnitTestCase
{
        public function testDoSomething()
        {
            $blah = new FooBarBaseAction();
            // assert something something
        }
}

Is this the correct way of doing it?  I have this feeling that it's
not... my code looks like a temporary hack... =)

Thanks!


[ simon.cpu ]

_______________________________________________
users mailing list
[email protected]
http://lists.agavi.org/mailman/listinfo/users

Reply via email to