Talk:Plugins::unitTests

From ZenMagick Wiki

Jump to: navigation, search

The example should be clearer, where should the file be placed?

There are two ways - either the class is added to zm_tests (anywhere under the tests folder), (new name is unitTests, btw), or it has to be registered programmatically. This is not ideal yet as it requires active code on the plugin/theme/whatever side to get tests recognized, though:

From the cron plugin (init() method):

       // register tests
       if (null != ($tests = ZMPlugins::instance()->getPluginForId('tests'))) {
           // add class path only now to avoid errors due to missing ZMTestCase
           ZMLoader::instance()->addPath($this->getPluginDirectory().'tests/');
           $tests->addTest('TestZMCronParser');
       }
Personal tools