PHPackages                             lionsad/drupal\_ti - 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. [DevOps &amp; Deployment](/categories/devops)
4. /
5. lionsad/drupal\_ti

ActiveLibrary[DevOps &amp; Deployment](/categories/devops)

lionsad/drupal\_ti
==================

Drupal - Travis Integration

1.4.4(9y ago)80118.5k36[15 issues](https://github.com/LionsAd/drupal_ti/issues)[6 PRs](https://github.com/LionsAd/drupal_ti/pulls)GPL-2.0+ShellPHP &gt;=5.3.0

Since Nov 29Pushed 5y ago12 watchersCompare

[ Source](https://github.com/LionsAd/drupal_ti)[ Packagist](https://packagist.org/packages/lionsad/drupal_ti)[ Docs](https://github.com/LionsAd/drupal_ti)[ RSS](/packages/lionsad-drupal-ti/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)DependenciesVersions (20)Used By (0)

drupal\_ti - Travis Integration for Drupal modules
==================================================

[](#drupal_ti---travis-integration-for-drupal-modules)

[![Build Status](https://camo.githubusercontent.com/d674c5e0e8498447bca406d61cf493ddca8a69916664064fadc5d493ddcdbbda/68747470733a2f2f7472617669732d63692e6f72672f4c696f6e7341642f64727570616c5f74692e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/LionsAd/drupal_ti)

Versions
========

[](#versions)

[![Latest Stable Version](https://camo.githubusercontent.com/91d3a957f8d59c85b9e788d804938c86cd352671c575c8a2eebe5d1af54662d2/68747470733a2f2f706f7365722e707567782e6f72672f6c696f6e7361642f64727570616c5f74692f762f737461626c65)](https://packagist.org/packages/lionsad/drupal_ti) [![Total Downloads](https://camo.githubusercontent.com/e53ede83010cb9fe7163fe998103bd70831fe46c2bee7b17ae37fb7d84de0220/68747470733a2f2f706f7365722e707567782e6f72672f6c696f6e7361642f64727570616c5f74692f646f776e6c6f616473)](https://packagist.org/packages/lionsad/drupal_ti) [![Latest Unstable Version](https://camo.githubusercontent.com/8e0ab795824e404353c23518bee29a2c84f9416cf772d02f0100862faa6b7361/68747470733a2f2f706f7365722e707567782e6f72672f6c696f6e7361642f64727570616c5f74692f762f756e737461626c65)](https://packagist.org/packages/lionsad/drupal_ti) [![License](https://camo.githubusercontent.com/1f52736c066a5a05cd3daa578266fa583e92bfac013e529c7561894e9dfcf263/68747470733a2f2f706f7365722e707567782e6f72672f6c696f6e7361642f64727570616c5f74692f6c6963656e7365)](https://packagist.org/packages/lionsad/drupal_ti)

### Welcome!

[](#welcome)

Welcome and thanks for trying drupal\_ti!

This will make it simple to use Travis CI to test your Drupal modules with simpletest and PHPUnit tests.

All you need is to push your drupal.org repository to GitHub, set up the module below, log in to travis-ci.org, set up the repo and you are up and running in no time.

### Setup

[](#setup)

Copy .travis.yml.dist to your root folder as .travis.yml and customize the `DRUPAL_TI_MODULE_NAME` global environment variable to match the name of your module.

You will also need to activate one matrix option, based on if you have support for SimpleTest, PHPUnit, Behat or all together:

```
env:
  matrix:
    # [[[ SELECT ANY OR MORE OPTIONS ]]]
    - DRUPAL_TI_RUNNERS="phpunit"
    - DRUPAL_TI_RUNNERS="phpunit simpletest behat"
```

This example would run PHPUnit as one matrix runner, which gives you results fast, then PHPUnit, SimpleTest and Behat as the slow runner.

If you want to run drupal\_ti with a Drupal-8 module, then you need to use:

```
- DRUPAL_TI_ENVIROMENT="drupal-8"
```

If you want to run drupal\_ti with a Drupal-9 module, then you need to use:

```
- DRUPAL_TI_ENVIROMENT="drupal-9"
```

### Using a different tests/ directory.

[](#using-a-different-tests-directory)

If your tests/ and composer.json are not in tests/ directory you will want to change:

```
before_install:
# Comment this line for different directories, e.g. composer in the root.
#  - cd ./tests
```

### How does it work

[](#how-does-it-work)

drupal\_ti provides a drupal-ti command, which is then called with each stage of Travis CI (e.g. `install`, `before_script`, ...).

By providing different runners in runners/simpletest or runners/phpunit/ the corresponding scripts are executed (e.g. runners/phpunit/script.sh).

Also diffent environments are included from `environments/$DRUPAL_TI_ENVIRONMENT.sh`, which makes it possible to distinguish easily between Drupal 7, Drupal 8 &amp; Drupal 9.

This gives you a modular Travis experience and as such the scripts can be very generic.

Drupal is installed in `$TRAVIS_BUILD_DIR/drupal_travis/drupal` and Drush is available after the `before_script` stage.

### How to customize the default behavior

[](#how-to-customize-the-default-behavior)

By using

```
- DRUPAL_TI_SCRIPT_DIR_BEFORE="./drupal_ti/before"
- DRUPAL_TI_SCRIPT_DIR_AFTER="./drupal_ti/after"
```

you can define your own scripts from your base directory, and drupal\_ti will call them before and after your main scripts.

This is useful to change default environment variables, e.g. environments/drupal-7.sh defines

```
export DRUPAL_TI_DRUSH_VERSION="drush/drush:6.*"
```

but you might want a different version and also override the `drupal_ti_install_drupal` function (as core-quick-drupal command needs drush 6).

Theoretically you can even define multiple by just seperating them with a space or installed via Composer - the possibilities are endless :).

Example:

```
- DRUPAL_TI_SCRIPT_DIR_BEFORE="./drupal_ti/before ./vendor/lionsad/drupal_ti_base_cool/drupal_ti/before"
- DRUPAL_TI_SCRIPT_DIR_AFTER="./drupal_ti/after  ./vendor/lionsad/drupal_ti_base_cool/drupal_ti/after"
```

### Adding module dependencies from GitHub repositories

[](#adding-module-dependencies-from-github-repositories)

Your module may have several dependencies that are not hosted on Drupal.org. These modules can be added using a custom script and `including` them in the `.travis.yml` file.

In `.travis.yml` you will have a section `before_script`. The default command here installs Drupal and the module we are testing. We can add a command `drupal-ti --include [script]`. This command will load the script first and then run the default `drupal-ti before_script` command.

#### .travis.yml

[](#travisyml)

```
before_script:
  # We run our script to add module dependencies
  # This uses git clone over HTTPS because the modules don't currently
  # exist on drupal.org.
  - drupal-ti --include drupal_ti/before/before_script.sh
  - drupal-ti before_script
```

The script path is relative to our `/tests` directory since we moved to that default directory during the `before_install` process.

We can now create our custom script as follows:

#### /tests/drupal\_ti/before/before\_script.sh

[](#testsdrupal_tibeforebefore_scriptsh)

```
#!/bin/bash

# Add an optional statement to see that this is running in Travis CI.
echo "running drupal_ti/before/before_script.sh"

set -e $DRUPAL_TI_DEBUG

# Ensure the right Drupal version is installed.
# The first time this is run, it will install Drupal.
# Note: This function is re-entrant.
drupal_ti_ensure_drupal

# Change to the Drupal directory
cd "$DRUPAL_TI_DRUPAL_DIR"

# Create the module directory (only necessary for D7)
# For D7, this is sites/default/modules
# For D8, this is modules
mkdir -p "$DRUPAL_TI_DRUPAL_DIR/$DRUPAL_TI_MODULES_PATH"
cd "$DRUPAL_TI_DRUPAL_DIR/$DRUPAL_TI_MODULES_PATH"

# Manually clone the dependencies
git clone --depth 1 https://github.com/my-project/my-dependency.git
# or with a different branch
git clone --depth 1 --branch 8.x-1.x https://github.com/my-project/my-dependency.git
```

The directory `/tests/drupal_ti/before/` can also be used to add auto-discovered scripts using a more complex pattern `/tests/before/runners/[runner]/[command].sh`. This will, however be limited to a specific runner, while the above `include` pattern will run for all runners.

#### Script with Composer Manager

[](#script-with-composer-manager)

Composer manager is a popular dependency and one that requires extra work in order to be set up.

```
#!/bin/bash

# Add an optional statement to see that this is running in Travis CI.
echo "running drupal_ti/before/before_script.sh"

set -e $DRUPAL_TI_DEBUG

# Ensure the right Drupal version is installed.
# The first time this is run, it will install Drupal.
# Note: This function is re-entrant.
drupal_ti_ensure_drupal

# Change to the Drupal directory
cd "$DRUPAL_TI_DRUPAL_DIR"

# Create the module directory (only necessary for D7)
# For D7, this is sites/default/modules
# For D8, this is modules
mkdir -p "$DRUPAL_TI_DRUPAL_DIR/$DRUPAL_TI_MODULES_PATH"
cd "$DRUPAL_TI_DRUPAL_DIR/$DRUPAL_TI_MODULES_PATH"

# Manually clone the dependencies
git clone --depth 1 --branch 8.x-1.x http://git.drupal.org/project/composer_manager.git

# Initialize composer manage
php "$DRUPAL_TI_DRUPAL_DIR/$DRUPAL_TI_MODULES_PATH/composer_manager/scripts/init.php"

# Ensure the module is linked into the code base and enabled.
# Note: This function is re-entrant.
drupal_ti_ensure_module_linked

# Update composer
cd "$DRUPAL_TI_DRUPAL_DIR"
composer drupal-rebuild
composer install --prefer-source
```

### Contributions

[](#contributions)

Contributions are welcome.

### Drush

[](#drush)

For your convenience the `drush site-set` command is set for the Drupal installation, so any Drush commands triggered in your own scripts will be run against the test Drupal instance.

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity43

Moderate usage in the ecosystem

Community27

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 80.4% 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 ~38 days

Recently: every ~85 days

Total

16

Last Release

3614d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/92a294a0cf0dd293e99686bd29fd61744319b5fcb0b1ca22dab265abaf38808b?d=identicon)[LionsAd](/maintainers/LionsAd)

---

Top Contributors

[![LionsAd](https://avatars.githubusercontent.com/u/354804?v=4)](https://github.com/LionsAd "LionsAd (225 commits)")[![WengerK](https://avatars.githubusercontent.com/u/1841592?v=4)](https://github.com/WengerK "WengerK (12 commits)")[![dsnopek](https://avatars.githubusercontent.com/u/191561?v=4)](https://github.com/dsnopek "dsnopek (10 commits)")[![mglaman](https://avatars.githubusercontent.com/u/3698644?v=4)](https://github.com/mglaman "mglaman (6 commits)")[![Decipher](https://avatars.githubusercontent.com/u/161090?v=4)](https://github.com/Decipher "Decipher (4 commits)")[![damontgomery](https://avatars.githubusercontent.com/u/397902?v=4)](https://github.com/damontgomery "damontgomery (3 commits)")[![taz77](https://avatars.githubusercontent.com/u/1389543?v=4)](https://github.com/taz77 "taz77 (3 commits)")[![Berdir](https://avatars.githubusercontent.com/u/40826?v=4)](https://github.com/Berdir "Berdir (3 commits)")[![slashrsm](https://avatars.githubusercontent.com/u/376889?v=4)](https://github.com/slashrsm "slashrsm (2 commits)")[![jibran](https://avatars.githubusercontent.com/u/2111106?v=4)](https://github.com/jibran "jibran (2 commits)")[![bojanz](https://avatars.githubusercontent.com/u/330162?v=4)](https://github.com/bojanz "bojanz (2 commits)")[![cboyden-ucb](https://avatars.githubusercontent.com/u/8573205?v=4)](https://github.com/cboyden-ucb "cboyden-ucb (2 commits)")[![yanniboi](https://avatars.githubusercontent.com/u/1744957?v=4)](https://github.com/yanniboi "yanniboi (1 commits)")[![FireGhost](https://avatars.githubusercontent.com/u/1060432?v=4)](https://github.com/FireGhost "FireGhost (1 commits)")[![hugovk](https://avatars.githubusercontent.com/u/1324225?v=4)](https://github.com/hugovk "hugovk (1 commits)")[![joshmiller83](https://avatars.githubusercontent.com/u/1440242?v=4)](https://github.com/joshmiller83 "joshmiller83 (1 commits)")[![lpmi-13](https://avatars.githubusercontent.com/u/5070516?v=4)](https://github.com/lpmi-13 "lpmi-13 (1 commits)")[![stopfstedt](https://avatars.githubusercontent.com/u/1410427?v=4)](https://github.com/stopfstedt "stopfstedt (1 commits)")

### Embed Badge

![Health badge](/badges/lionsad-drupal-ti/health.svg)

```
[![Health](https://phpackages.com/badges/lionsad-drupal-ti/health.svg)](https://phpackages.com/packages/lionsad-drupal-ti)
```

###  Alternatives

[deployer/deployer

Deployment Tool

11.1k25.4M207](/packages/deployer-deployer)[appwrite/server-ce

End to end backend server for frontend and mobile apps.

55.3k84.2k](/packages/appwrite-server-ce)[pragmarx/health

Laravel Server &amp; App Health Monitor and Notifier

2.0k1.0M2](/packages/pragmarx-health)[felixfbecker/language-server-protocol

PHP classes for the Language Server Protocol

22476.7M6](/packages/felixfbecker-language-server-protocol)[heroku/heroku-buildpack-php

Toolkit for starting a PHP application locally, with or without foreman, using the same config for PHP and Apache2/Nginx as on Heroku

8161.3M10](/packages/heroku-heroku-buildpack-php)[tiamo/phpas2

PHPAS2 is a php-based implementation of the EDIINT AS2 standard

4674.7k](/packages/tiamo-phpas2)

PHPackages © 2026

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