Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unittests should be included across the board #4

Open
theredhead opened this issue Nov 27, 2011 · 2 comments
Open

Unittests should be included across the board #4

theredhead opened this issue Nov 27, 2011 · 2 comments
Assignees
Milestone

Comments

@theredhead
Copy link
Owner

Personally, I don't like phpunit. mostly because it uses poormans namespacing that makes the code look... ugly. I'm sure it is a great product but I believe we can do better.

Lets integrate unit testing into the framework. make it so stupidly easy to do unit tests that it feels natural and it gets done properly.

Obviously, the framework itself needs proper testing as well.

@theredhead
Copy link
Owner Author

I got a very basic testrunner going that runs all tests methods from red.ITestable classes that you pass in on the command line. It does this by writing out a temp file to sys_get_temp_dir() with the stub code needed to run for each single test method. A test method is defined for this purpose to be any public method that requires no arguments and has the text '@test' in its DocComment.

I'm testing the whole thing on MBString at the moment. output is very simple xml so it can be parsed easily so a web frontent can also become part of the framework.

Automagic discovery of testable classes still needs to be done.

@theredhead
Copy link
Owner Author

Added automated aggregation of tests to the command line tool using the -dir directive on the command line. This will scan the directory for tests to run and include all found ITestable classes to the list of tests to run. multiple directories can be scanned.

Also added very basic UI in the form of a control (red.web.ui.controls.unittesting.TestUserInterface) that will run framework tests if not otherwise instructed.

Unittesting is now possible, but nowhere near as good as in phpunit. its' a start tho.

@ghost ghost assigned theredhead Nov 30, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant