phpcr / phpcr-utils

A set of helper classes and command line commands you want to use with phpcr, but that are not part of the API itself
phpcr.github.io
Other
72 stars 30 forks source link

Functional tests for Commands #58

Closed dantleech closed 11 years ago

dantleech commented 11 years ago

Add functional tests for commands, see:

http://symfony.com/doc/2.0/components/console/introduction.html#testing-commands

dbu commented 11 years ago

so far we added functional tests for phpcr-utils to phpcr-api-tests. this because we need an implementation for them, and the phpcr api tests already provide the test bed. could this make sense here too? (with automatically skip the tests if phpcr-utils classes are not available.

dantleech commented 11 years ago

Personally prefer to work with one repository, i.e.

git clone ...
cd phpcr-utils
composer install --dev
phpunit -c phpunit.xml.dist ..
vim ...

This way the bundle is more self-contained, and I can do all the development I need to with the single repository. Also, if I push a PR to phpcr-utils, the tests are not going to get executed - so we lose automatic regression testing.

So I would push for more self-containment where it makes sense, this ticket would maybe be a good candidate for the Testing component.

dbu commented 11 years ago

you do have a point here, yes. maybe we could have jackalope-doctrine-dbal in require-dev of the utils to do functional tests here? ideally the tests themselves would be in a way that all jackalopes can also bootstrap and run them, like we do with the unit tests of phpcr, phpcr-utils and jackalope/jackalope today.

the testing component probably not, we should not need symfony and the cmf to test this.

dantleech commented 11 years ago

actually I figured out that we can probably avoid functional tests for the Commands - the main problem was that the TreeWalker was doing loads of crazy stuff in the dump command - but we can refactor the tree walker into a helper and mock it. So hopefully we can put aside the functional testing issue - in theory PHPCR is great for mocking.

dbu commented 11 years ago

we do have quite some testing for commands now i think. do we need more or should we close this?

dantleech commented 11 years ago

All commands are /unit/ tested. Don't know how much additional value we get from functional tests. The underlying stuff should work

David Buchmann notifications@github.com a écrit :

we do have quite some testing for commands now i think. do we need more or should we close this?


Reply to this email directly or view it on GitHub: https://github.com/phpcr/phpcr-utils/issues/58#issuecomment-19163817

Envoyé de mon téléphone Android avec K-9 Mail. Excusez la brièveté.