The purpose of this fork is maintain Version 1.2.0 for future compatibility with PHP 7.x. Any contributions towards this mean are appreciated.
PHP ActiveRecord has a full set of unit tests, which are run by PHPUnit.
In order to run these unit tests, you need to install the required packages using Composer:
composer install
After that you can run the tests by invoking the local PHPUnit
To run all test simply use:
vendor/bin/phpunit
Or run a single test file by specifying its path:
vendor/bin/phpunit test/InflectorTest.php
You might notice that some tests are marked as skipped. To obtain more information about skipped
tests, pass the --verbose
flag to PHPUnit:
vendor/bin/phpunit --verbose
Some common steps for fixing skipped tests are to:
- Install
memcached
and the PHP memcached extension (e.g.,brew install php56-memcache memcached
on macOS) - Install the PDO drivers for PostgreSQL (e.g.,
brew install php56-pdo-pgsql
on macOS) - Create a MySQL database and a PostgreSQL database. You can either create these such that they are available at the default locations of
mysql://test:test@127.0.0.1/test
andpgsql://test:test@127.0.0.1/test
respectively. Alternatively, you can set thePHPAR_MYSQL
andPHPAR_PGSQL
environment variables to specify a different location for the MySQL and PostgreSQL databases.