Need help with Codeception testing

Alright, I’m finally using codeception and I love it, but I’m running into a few slight issues. Let’s start with the major one first.

  1. Here’s the test.

public function confirmEmail(FunctionalTester $I)

    {

        $user = $I->grabFixture('user');

        $I->amLoggedInAs($user);

        

        $I->seeRecord('common\models\User', array('username' => 'troy.becker', 'status' => '5'));

        $I->amOnRoute('site/email-confirmation', ['token' => 'SuP1dwzoDf8cCF-FUigeGCM466bLUDt5']);

        $I->seeRecord('common\models\User', 

                array('username' => 'troy.becker', 

                    'status' => '10', 

                    'email_confirm_token' => null));

        

        $I->see('Your email has been confirmed');

    }

Here’s the thing… ‘site/email-confirmation’ generates a new entry in the “profile” table. No big deal, BUT when codeception tries to rollback the transactions, I get this error.

[yii\db\Exception] SQLSTATE[42000]: Syntax error or access violation: 1305 SAVEPOINT LEVEL1 does not exist

The SQL being executed was: RELEASE SAVEPOINT LEVEL1

Now, if I set "cleanup" to false in the codeception config file, the test will pass fine. However, now I will have to reset my database every single time I run this test. Not something I want to do.

So, how do I fix this? What do I need to do to enable codeception to rollback the newly generated entry in the database? Seems like codeception doesn’t like the creation of new entries that wasn’t put there via fixtures. Would appreciate the help.

  1. Slightly related to 1. Is there anyway to get the data from a fixture? For example, in the above code, I use $user for fixture data. If I want the username, how can I get it? I’ve tried $user->username and $user[‘username’] but to no avail.

  2. Given that codeception’s test run in a terminal, is there anyway to see the contents of the objects used? I would love to do a var_dump of $user or $I and see inside.

Thanks in advance.

No one can help on this?