Skip to content

Files

Latest commit

e3a335e · Jul 5, 2023

History

History

tests

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Feb 8, 2018
Mar 18, 2019
Sep 26, 2017
Oct 23, 2015
Feb 7, 2018
Apr 11, 2019
Jul 5, 2023
Apr 11, 2019
Jun 19, 2017
May 30, 2018
Apr 11, 2019
May 30, 2018
May 30, 2018
May 30, 2018
May 30, 2018

Phalcon Incubator Tests

Welcome to the Phalcon Incubator Testing Suites.

This folder includes all the tests that test Incubator components, ensuring that you enjoy a bug free library.

Getting Started

These testing suites uses Travis CI for each run. Every commit pushed to this repository will queue a build into the continuous integration service and will run all tests to ensure that everything is going well and the project is stable.

The testing suites can be run on your own machine. The main dependency is Codeception which can be installed using Composer:

# run this command from project root
composer install --prefer-source

You can read more about installing and configuring Codeception from the following resources:

Requirements

A MySQL database is also required in this suite. You'll need to create database and configure connection in tests/.env file.

Some tests uses Aerospike database and they are run separately. To uses those tests you need to install the Aerospike Server, Aerospike Client and create the database.

You may need the following services to run other tests:

  • Memcached
  • Redis
  • MongoDB
  • Beanstalk

Docker Compose

As an alternative to installing the above requirements, you may also utilize the included docker-compose.yml. This requires docker-compose and docker to be installed. You will need to update your tests/.env file appropriately to point to the resulting docker containers. You may start the containers by running:

docker-compose up

Run tests

First you need to re-generate base classes for test all suites:

vendor/bin/codecept build

Once the database is created and base clases re-generated, run the tests on a terminal:

vendor/bin/codecept run

or for detailed output:

vendor/bin/codecept run --debug

To run all tests from a folder:

vendor/bin/codecept run tests/unit/some/folder/

To run legacy tests (PHP 5.x) you need to use the unit5x suite:

vendor/bin/codecept run tests/unit5x/

To run Aerospike-related tests you need to use the aerospike suite:

vendor/bin/codecept run tests/aerospike/

To run single test:

vendor/bin/codecept run tests/unit/some/folder/some/test/file.php

Advanced Configuration

The test suites ship with .dist.yml configuration files:

codeception.dist.yml
tests/aerospike.suite.dist.yml
tests/unit.suite.5.dist.yml
tests/unit.suite.dist.yml
tests/unit5x.suite.dist.yml

You may override the options in each of these files by creating a new configuration file of the same name, without the .dist. For example, to auto-populate/reset the database on every unit test, create the file tests/unit.suite.yml with:

modules:
    config:
        Db:
            populate: true

For additional configuration options, see http://codeception.com.

Help

Note: Cache-related tests are slower than others tests because they use wait states (sleep command) to expire generated caches.

The file .travis.yml contains full instructions to test Phalcon Incubator on Ubuntu 14+ If you cannot run the tests, please check the file .travis.yml for an in depth view on how test Incubator. Additional information regarding our testing environment can be found by looking at the tests/_bootstrap.php file.


Please report any issue if you find out bugs or memory leaks.
Thanks!

Phalcon Framework Team
2017