joomla / joomla-framework

[READ-ONLY] This repo is no longer in active development. Please see https://github.com/joomla-framework for the individual Framework packages.
http://framework.joomla.org
GNU General Public License v2.0
188 stars 141 forks source link

Improvements to Test package #311

Open piotr-cz opened 10 years ago

piotr-cz commented 10 years ago
mbabker commented 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.

piotr-cz commented 10 years ago

DDL

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

TestConfig

Let's get rid of this one then.

piotr-cz commented 10 years ago

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