samedi 1 octobre 2016

Using fixtures in functional test for Yii2 application

I write functional tests for Yii2-application. For some tests I need refill database.

  • I extended SignupCest from DbTestCase, like I did it with unit tests
  • I renamed SignupCest to SignupTest
  • I use $this->tester insread $I

If the test passes, all fine. But I make test fell by change $this->tester->see('Signup', 'h1'); to $this->tester->see('Signup', 'h2'); and I get only cross without any details: enter image description here

I rerun Codeception with flag --debug, but I don't get usefull information. Only stack trace with message: exception 'yii\base\ErrorException' with message 'Call to a member function has() on null' in /var/www/sources/vendor/codeception/codeception/src/Codeception/Module/Yii2.php:197

Thans in advance.

Aucun commentaire:

Enregistrer un commentaire