Open piotr-cz opened 10 years ago
The DDL is indeed a holdover from Platform development when the CMS was still heavily supported, but the structure of the DDL itself shouldn't really matter for testing as far as whether it's the CMS schema or that of the issue tracker. What would you suggest for the DDL?
TestDatabase
and WebInspector
should probably be documented as classes specific for PHPUnit use and explain what they support.
There's a part of me that thinks WebInspector
should really be built out into a proper web application mockup and a CliInspector
be added as well to help with application testing.
IMO TestConfig
isn't needed (truthfully, it's not even used right now; WebInspector
"uses" it in an unused method). It's another holdover from Platform based development and comparable to the CMS' configuration.php file. I think many of us who are implementing framework apps are using JSON based config files so I'd say drop this class, add a simple config.json
, and rework WebInspector
to use that.
I'd suggest an option to use own DDL, the question is how. I'd probably abstract file loading part to new method:
/**
* Load your DDL file here
*/
public function getDdl()
{
return file_get_contents(__DIR__ . '/Schema/ddl.sql');
}
Unfortunately there is slight difference between Install SQL file and testing one. First one is usually written in MySQL, second one should be in SQLite, which are incompatible.
WebInspector
and CliInspector
I'm not sure we need these because
AbstractWebApplication
and AbstractCliApplication
have own testWebInspector
or CliInspector
but your own specific ones.TestConfig
Let's get rid of this one then.
Maybe it's worth investigating if the DDL schema could be written in a XML file using a (undocumented) DatabaseImporter and DatabaseExporter classes. I never checked these. Side note: Sqlexporter discussion
TestDatabase::setUpBeforeClass
loads up a unit test DDL file which is probably intended for Joomla CMSTestDatabase
,TestConfig
andWebInspector
TestConfig
needed in this package?