Phpixie module for Codeception

v1.2.0 2018-10-22 09:59 UTC

This package is auto-updated.

Last update: 2020-05-23 19:54:44 UTC



You can install this package through composer:

composer require visavi/codeception-phpixie


Include the phpixie module in the tests/functional.suite file

actor: FunctionalTester
        - Phpixie:
            url: 'http://localhost'
        - \Helper\Functional

In acceptance tests, you can use methods to work with a database of functional tests.

To do this, you must enable the module in the tests/acceptance.suite file

actor: AcceptanceTester
        - PhpBrowser:
            url: http://localhost
        - Phpixie:
            part: ORM
        - \Helper\Acceptance

After that 7 methods will be available to work with the database.

Methods for working with the DB

All methods work in a transaction, which means that after the tests are completed, the database will be in its original form

Inserts record into the database
$user = $I->haveRecord('user', ['name' => 'phpixie']);
Checks that record exists in database.
$I->seeRecord('user', ['name' => 'phpixie']);
Checks that record does not exist in database.
$I->dontSeeRecord('user', ['name' => 'trixie']);
Retrieves record from database.
$record = $I->grabRecord('user', ['name' => 'phpixie']);
Removes a record from the database.
$I->deleteRecord('user', ['id' => $user->id]);

Transaction control methods do not look at the global transaction enable settings, if you have transactions enabled by default, you can turn them off for each method

Conversely, if transactions are globally disabled (cleanup: false), then methods can force transactions to be enabled.


Call methods

Calling methods for functional and acceptance tests:


Calling methods for unit tests:



$data = [
    'login'    => 'phpixie',
    'password' => 'password',
    'name'     => 'trixie',

$entity = $I->haveRecord('user', $data);

$I->seeRecord('user', ['id' => $entity->id]);

$I->wantTo('Test user page');
$I->amOnPage('/user/' . $entity->login);


The class is open-sourced software licensed under the MIT license