PHP

Solano CI supports PHP. See Guzzle PHP HTTP client as one of our Example Repositories. If you need a version or tool other than one of the default installed versions below, please contact support@solanolabs.com.

Composer

Composer is installed and executable in each of the versioned environments.

  • PHP 5.3 (5.3.29) + Pear 1.9.4
  • PHP 5.4 (5.4.29)
  • PHP 5.5 (5.5.16)
  • PHP 5.6 (5.6.0)
  • PHP 7.0 (7.0.9)

You can use a pre_hook to build and install packages, control caching with caching directives in solano.yml, and run arbitrary commands to execute tests.

php:
  version: '5.5.16'
hooks:
  pre_setup: composer.phar install
  worker_setup: echo "Per-worker setup; nothing to do in simplest case"
  post_setup: echo "Package assets or otherwise prepare to run tests"
  post_build: echo "Deploy to application server here"
cache:
  key_paths:
    - composer.json
    - composer.lock
  save_paths:
    - vendor
test_pattern: 'none'
tests:
  - phing
  - echo "shell command to run tests"

Also it is possible to customize test command name using name key:

tests:
  - name: some echo command
    command: echo "shell command to run tests"

PHPUnit

Solano CI supports running PHPUnit tests in parallel with the solano-phpunit wrapper. Include the solano/solano-phpunit package in the composer.json file:

"require-dev": {
   "phpunit/phpunit": "^4.0"
   "solano/solano-phpunit": "*"
},

Set PHPUnit tests to run in parallel with solano-phpunit:

tests:
  - type: phpunit
    mode: parallel
    output: exit-status
    command: vendor/bin/solano-phpunit
    config: custom-phpunit.xml    # Defaults : phpunit.xml, phpunit.xml.dist
    files:
      - tests/**Test.php

Also it is possible to customize test command name using name key:

tests:
  - name: my php test 1
    type: phpunit
    mode: parallel
    output: exit-status
    command: vendor/bin/solano-phpunit
    config: custom-phpunit.xml
    files:
      - tests/**Test.php

Environment

Note that you can set the PHPRC environment variable to set the path to a custom php.ini. For instance, you might add the following to solano.yml:

environment:
  PHPRC: '/home/user/src/repo/MY_REPO_NAME/php.ini'

Where MY_REPO_NAME is replaced with the name of your repository.