Issue with Advance App Codeception Test

I’v been moving over from the 2.0 beta to the 2.0 release but I’m having an issue when I run the base codeception tests, I haven’t modified them but I get this error :

PHP Fatal error: Call to undefined function tests\codeception\frontend\models\expect() in /var/www/html/dev/tes

ts/codeception/frontend/unit/models/PasswordResetRequestFormTest.php on line 39

Here is that section of the test, yellow is line 39




31

32    public function testSendEmailWrongUser()

33    {

34        $this->specify('no user with such email, message should not be send', function () {

35

36            $model = new PasswordResetRequestForm();

37            $model->email = 'not-existing-email@example.com';

38

39            expect('email not send', $model->sendEmail())->false();

40

41        });

42



Any ideas ?

Thanks,

C

You need to install Specify and Verify libraries using composer. You have installation instructions HERE.

Also after you install them make sure that mail folder inside forontend/runtime is writable, you may get that error next.

That solved that problem thanks!

I’m seeing something new though , every unit test fails whenever it makes a call to create a user object. Even the ones that come with the framework.




Codeception PHP Testing Framework v2.0.5

Powered by PHPUnit 4.2.2 by Sebastian Bergmann.


Tests\codeception\frontend.unit Tests (2) ---------------------------------------------

------------------------------------------

Trying to test correct signup (tests\codeception\frontend\unit\models\SignupFormTest::t

estCorrectSignup)                    Fail

Trying to test not correct signup (tests\codeception\frontend\unit\models\SignupFormTes

t::testNotCorrectSignup)             Ok

---------------------------------------------------------------------------------------

------------------------------------------




Time: 624 ms, Memory: 13.75Mb


There was 1 failure:


---------

1) tests\codeception\frontend\unit\models\SignupFormTest::testCorrectSignup

user should be valid

Failed asserting that null is an instance of class "common\models\User".



Is there something else I might have missed, or mis-configured ?

Thanks,

C

Have you ran migration to install user table in test database (and set Codeception to use test database) ?