PHPackages                             ride/test - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. ride/test

ActiveLibrary[Testing &amp; Quality](/categories/testing)

ride/test
=========

Bridge between PHPUnit, Selenium and Ride

1.0.3(8y ago)0100PHPPHP ^7.0

Since Mar 7Pushed 8y ago9 watchersCompare

[ Source](https://github.com/all-ride/ride-test)[ Packagist](https://packagist.org/packages/ride/test)[ RSS](/packages/ride-test/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (10)Versions (7)Used By (0)

Ride testing
============

[](#ride-testing)

This library bridges the gap between PHPUnit, Selenium and Ride.

```
composer require --dev ride/test
```

Installation
------------

[](#installation)

This module doesn't trigger a composer post-install script yet. So you should manually copy the `dist/` folder to your project root. You should also modify the `parameters.php` file to let Ride know when to use the test environment. More about that later.

### Test environment configuration

[](#test-environment-configuration)

You can use `application/config/test/` for test-specific parameters, routes and dependencies.

The test environment uses a SQLite database. This database is copied from a master template for each test, ensuring every test case has a clean database instance. You can use an SQLite browser to add data to the clean test database: `application/test/clean.test.db`. You could also make other databases and use those as a template for individual test cases. This is done by extending `RideTestCase` and calling `$this->cleanDatabase('path/to/my/clean/test.db')`. The current database used for a test case can be found in `application/test/test.db`.

### Creating a clean database

[](#creating-a-clean-database)

This library enables the `testdb generate` command. When run, the command will take the MySQL connection and generate an SQLite database from it. Specific model data can be copied per model, and a file can be specified in which to save the SQLite database.

```
cli testdb generate --file=test/clean.test.db Dealer User TaxonomyTerm Mail
```

Running this command is very useful in early development, when you're still updating models.xml.

PHPUnit tests
-------------

[](#phpunit-tests)

Your test classes should be saved in the `application/test` folder. They can either extend the normal PHPUnit TestCase, or extend `ride\testing\RideTestCase`. Doing this makes the Ride `System` and `DependecyInjector` available in your tests. Note that you should always call `parent::setUp()` and `parent::tearDown()` when you're overriding these methods.

Tests can be run with the following command.

```
vendor/bin/phpunit

# Or, if PHPUnit is installed globally
phpunit

# Or, a specified test file
phpunit application/test/statik/orm/model/MyModelTest.php
```

Selenium tests
--------------

[](#selenium-tests)

Like PHPUnit tests, there is a class available which you can extend Selenium test classes from: `ride\testing\SeleniumRideTestCase`

### Prerequisites

[](#prerequisites)

Selenium requires Java and a JDK to run; you can find download links to the current JDK here: .

Furthermore, you'll need a specific browser to run tests on. Certain versions of Firefox work out of the box, but some don't. If you're on Mac and want to play safe, a working Chrome driver is included in the `dist/bin` of this library. If you want to use another driver, you can look around here: .

To tell Ride it has to use the test environment when running Selenium tests, you should add the following lines in `application/config/parameters.php`, after the environment detection.

```
if (file_exists(__DIR__ . '/../../.selenium')) {
 $environment = "test";
}
```

### Running tests

[](#running-tests)

The Selenium server should always run in the background when running tests. The server also logs a lot of useful information while testing.

```
# Run Selenium in the background, with the provided Chrome driver.
./selenium-server-chrome.sh

# Or run selenium with your own driver.
sh vendor/se/selenium-server-standalone/bin/selenium-server-standalone -Dwebdriver.chrome.driver=bin/chromedriver
```

```
# Run all selenium tests.
phpunit --testsuite selenium

# Or run a specific test.
phpunit --testsuite selenium --filter test_inquiry_form_submit
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~31 days

Total

5

Last Release

3229d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6d98d3f0d5db5eb241c6ee74bcee87d1e7dc1aaf7942b933d68e612ee2352eea?d=identicon)[ride-user](/maintainers/ride-user)

---

Top Contributors

[![kayalion](https://avatars.githubusercontent.com/u/2340819?v=4)](https://github.com/kayalion "kayalion (3 commits)")

### Embed Badge

![Health badge](/badges/ride-test/health.svg)

```
[![Health](https://phpackages.com/badges/ride-test/health.svg)](https://phpackages.com/packages/ride-test)
```

###  Alternatives

[jasonmccreary/laravel-test-assertions

A set of helpful assertions when testing Laravel applications.

3513.9M32](/packages/jasonmccreary-laravel-test-assertions)[ergebnis/phpunit-slow-test-detector

Provides facilities for detecting slow tests in phpunit/phpunit.

1468.1M72](/packages/ergebnis-phpunit-slow-test-detector)[typo3/testing-framework

The TYPO3 testing framework provides base classes for unit, functional and acceptance testing.

675.0M775](/packages/typo3-testing-framework)[webmozarts/strict-phpunit

Enables type-safe comparisons of objects in PHPUnit

31252.7k5](/packages/webmozarts-strict-phpunit)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
