jacmoe
(Jacob Moena)
January 24, 2016, 9:47pm
1
It is really cool that the advanced app template has Codeception tests…
But how do you create new tests ?
I want to create a unit test in the common dir for the User model.
What directory exactly am I supposed to be in and what command do I need to be making?
I can build and run the existing tests but that is not really useful to me - I need to be able to create tests.
Codeception docs does not take the special layout that the advanced app has into account…
jacmoe
(Jacob Moena)
January 25, 2016, 10:20am
2
So, I navigated to tests/codeception/common and ran the following command:
codecept generate:phpunit unit models/UserTest
I assume that is what you need to do, right?
jacmoe
(Jacob Moena)
January 25, 2016, 2:47pm
3
Or, if we want to use Codeception powered unit tests:
codecept generate:test unit models/UserTest
It looks like the unit tests shipped with the advanced template does not use Codeception style unit tests but phpunit style unit tests because I don’t see the overridden _before and _after methods, am I right?
I wish that the documentation for this was more complete
jacmoe
(Jacob Moena)
January 25, 2016, 2:48pm
4
I take it that none of you guys are actually using Codeception ?
amir.duran
(Amir Duran)
January 26, 2016, 6:56am
5
jacmoe:
So, I navigated to tests/codeception/common and ran the following command:
codecept generate:phpunit unit models/UserTest
I assume that is what you need to do, right?
Yep, exactly as I did it.
jacmoe
(Jacob Moena)
January 26, 2016, 7:50am
6
Thanks Duri
At least that makes two of us.
jacmoe
(Jacob Moena)
January 26, 2016, 9:05am
7
I am currently learning from Dektrium/yii2-user - they have some neat Codeception testing code