Skip to content
This repository has been archived by the owner on Nov 26, 2017. It is now read-only.

Improvements to Test package #311

Open
piotr-cz opened this issue Dec 10, 2013 · 3 comments
Open

Improvements to Test package #311

piotr-cz opened this issue Dec 10, 2013 · 3 comments

Comments

@piotr-cz
Copy link
Contributor

  • TestDatabase::setUpBeforeClass loads up a unit test DDL file which is probably intended for Joomla CMS
  • Missing documentation for TestDatabase, TestConfig and WebInspector
  • Is TestConfig needed in this package?
@mbabker
Copy link
Contributor

mbabker commented Dec 11, 2013

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
Copy link
Contributor Author

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

  • AbstractWebApplication and AbstractCliApplication have own test
  • When writing test for your project, probably you won't be using WebInspector or CliInspector but your own specific ones.

TestConfig

Let's get rid of this one then.

@piotr-cz
Copy link
Contributor Author

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants