Yii Codeception Module

I also see that you wrote some helpers for Codeception - like login, etc. Looks like it could be useful.

Any license on those things?

I am not using the dump.sql file, but I think it has to be defined in the config.

I use migrations to setup the test db, although they were not created for that purpose.

But for the details you’ve to talk to @Ragazzo.

I will put a random db dump in there - thanks for the hint.

((Actually, I will put a dump of the real db, sans data))

Migrations sounds like a great idea!

Was this question for me or Ragazzo? … if it was for me, all stuff I publish on github is BSD licensed.

Question was for you, of course. Thanks. :)

I will ask more later when I have un-confused myself.

You can use them with Codeception only in phpunit tests, so like




MyCodeceptionYiiPhpunitTest extends CDbTestCase

{

}



About article, yes, i’ve finished it yesterday, it is now up to DavertMik to make maybe some markup editions or smth. else. Article mainly about some codeception features (CEST classes), my “vision” of BDD and differences between acceptance and functional tests, difference between Behat+Mink and Codeception and why do i prefer Codeception over Behat+Mink, and about using Codeception with CI Jenkins (basically through phpunit Jenkins plugin). So whole article is divided in this 3 parts.

Also, @schmunk can i ask you (if you of course will have time) about maybe writing article or some brief-look of codeception too?)) I mean that if someone using codeception feel free to share with community your experience)

Also if that article will be interested for users, maybe i will write one more about codeception event-handling and groups(similar to tags in behat). For now afaik DavertMik writing code for "groups" feature.

@Ragazzo: For sure you can ask, but … I am like a testing noob, can’t really write an article about codeception ;) and I really don’t have the time at the moment. Sorry.

Yes, time is that we all need)) ok, hope you like codeception and write more tests with it ;)

Well, guys there is a first of three part of that article is now available, thanks to DavertMik)

http://codeception.com/05-06-2013/specification-testing-coparison.html

Please feel free to comment, and maybe add some suggestions.

Hi guys, so after new Codeception release 1.6.1 , second part of the article was released, it contents some recipes on how to use new CEST classes formats and some differences between CESTs and CEPTs.

http://codeception.com/05-11-2013/playing-with-cests.html

Also pay attention to recipes that was written by davertMik http://codeception.com/docs/07-AdvancedUsage . It also contents new features overview, such like groups.

So, last chapter (3 of 3) of my recipe-article is available on Codeception site, some useful tips and tricks:

http://codeception.com/05-24-2013/jenkins-ci-practice.html

Thanks for support on github too ;)

Hi,

I’m having problems with the autoloader. If I run a suite of tests individually (eg unit or functional) no problems, but if I try to run all tests for the project then I run into problems with loading the modules.

It seems that it pre-loads all modules before running any tests. It loads the functional test modules first which includes Yii1, then it loads the unit test modules but because Yii1 has included Yii, it tries loading through YiiBase::autoload which then cannot find ‘[yii base path]/../../Codeception/Modules/Yii1.php’ for example.

Any ideas on what I’m doing wrong?

Bogsey, sorry for the late answer, yes seems like problems in autoloaders, anyway i suggest for Yii1 functional tests use PhpBrowser and for acceptance WebDriver, there were some problems due Yii1 architecture, good to know that they are solved in Yii2.

Also you and other developers can help us to test Yii2 and Codeception integration for yii2-advanced/yii2-basic boilerplates. See this PR for comments/suggestions:

Thank you and all yii developers that help Codeception :)

Hey Ragazzo, after you hinted me about Codeception, I’ve given it a go, and I’m really pleased so far.

Great job on the articles you wrote as well.

I’m planning to present it to our next Yii London Meetup.

Anyway, I didn’t have any problems in working with functional tests (namely Codeception, Yii1, PHPBrowser) and it has proved to be a smooth operation so far.

Now I’m facing some doubts regarding Unit tests (probably because I miss a bit of knowledge of the internals).

I prefer to post it here before I start getting mad doing trial&error to make them work.

The Yii1 module should be loaded for Unit tests as well?

The access to Yii internal functions (such as Yii::app() etc) is it done through the Module accessor of Codeception? (see http://codeception.com/docs/06-UnitTests#Modules)

Anything else I should be aware of regarding unit tests?

Hello everyone!

I am trying to integrate Codeception with Yii, but I have problems. I followed the steps on codeception page but after I run my first simple acceptance test it says :

Yii1 module is not configured. Please provide application bootstrap file configured for testing. :confused:

Am I missing something?

Can anyone put clear instructions on how to integrate, please?

Hi lejla, I’ve given a talk at the Yii London Meetup a couple of months ago.

By the sound of it, it seems you need to install and configure Yii1 bridge, that’s probably the only requirement that will bind Yii1 with Codeception (mostly placing the right autoloader for it to work correctly).

See the slides and video of the talk here:

See if that is covering what you need, otherwise just post a reply here and I’ll see if there’s anything else amiss.

Hi All,

I’m trying to make testing with codeception in a yii1 application. Now I’m able to:

  • run acceptance tests with either phpbrowser or webdriver (selenium of phantomjs),

  • run unit tests

The unit tests are phpunit style that can test ActiveRecord models too.

But, I’m not able to get coverage reports (0/0) everywhere.

And I’m afraid that not using Yii1 module at all (not enabled in any yml files).

Am I right if I think that Yii1 module is only used for functional testing?

Do I have to use yii-bridge for this situaton?

Did anyone get good coverage output? During my first steps, when nothing was working well I’ve seen one, but those were generated for the yii framework and extensions, but not the app code. Now, I cannot reach this at all.