Navigation Menu

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

Command to generate a template for testing commands #6349

Open
tsteur opened this issue Sep 30, 2014 · 4 comments
Open

Command to generate a template for testing commands #6349

tsteur opened this issue Sep 30, 2014 · 4 comments
Labels
c: Tests & QA For issues related to automated tests or making it easier to QA & test issues. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.

Comments

@tsteur
Copy link
Member

tsteur commented Sep 30, 2014

It is possible to generate a test via ./console generate:test. So far it is possible to generate a unit, database and integration test case. It would be nice to have the possibility to choose "command" as well. This would make it much easier to write tests for a command and the easier it is, the more likely we are writing tests for commands. Makes it also easier for plugin developers.

An example for such a command test is here: https://github.com/piwik/plugin-PiwikDebugger/blob/master/tests/Unit/ListEventObserversTest.php I think.

Alternatively, - maybe this is even better - when generating a command, we could also directly create a test file for this command. So we would kinda automatically write a test for it (maybe ;) ). Therefore we could create a test example in "ExampleCommand" plugin

@tsteur tsteur added the Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. label Sep 30, 2014
@tsteur
Copy link
Member Author

tsteur commented Sep 30, 2014

Midterm maybe?

@diosmosis
Copy link
Member

Feel free to modify ConsoleCommandTestCase (it's in core). Never got around to doing anything serious w/ it, and I doubt I will at this point.

@tsteur
Copy link
Member Author

tsteur commented Sep 30, 2014

I'm ok with ConsoleCommandTestCase. It's only about providing a generator for it so that we do not have to create a file manually. Also plugin developers would probably not know such a test case exist and need some guidance

@mattab mattab added this to the Mid term milestone Sep 30, 2014
@mattab
Copy link
Member

mattab commented Sep 30, 2014

Added to mid term though it seems important even for us to write tests easily...

@mattab mattab added the c: Tests & QA For issues related to automated tests or making it easier to QA & test issues. label Oct 10, 2014
@mattab mattab modified the milestones: Long term, Mid term Dec 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Tests & QA For issues related to automated tests or making it easier to QA & test issues. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
Projects
None yet
Development

No branches or pull requests

3 participants