diff --git a/.travis.yml b/.travis.yml index bd090ad6..0faf5d5b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,7 @@ language: php php: + - 5.3 - 5.4 - 5.5 - 5.6 @@ -16,6 +17,8 @@ env: matrix: exclude: + - php: 5.3 + env: DRUPAL_VERSION=8 - php: 5.4 env: DRUPAL_VERSION=8 - php: 5.6 @@ -33,7 +36,10 @@ install: # Use the example composer.json file for Drupal 8. - test ${DRUPAL_VERSION} -eq 8 && cp doc/_static/composer.json.d8 ./composer.json || true - composer install - - composer global require drush/drush:dev-master --prefer-source + # Drush version must vary depending on environment and version of core. + - test ${DRUPAL_VERSION} -eq 8 && composer global require drush/drush:dev-master --prefer-source || test ${TRAVIS_PHP_VERSION} -eq 5.3 && composer global require drush/drush:~6.0 || composer global require drush/drush:~7.0 + # PHP 5.3 requires the cgi extension for runserver. + - test ${TRAVIS_PHP_VERSION} -eq 5.3 && pecl install cgi || true - npm install before_script: @@ -63,6 +69,7 @@ before_script: - sleep 4s script: + - find ./src -name "*.php" -print0 | xargs -0 -n1 -P8 php -l - vendor/bin/phpspec run -f pretty --no-interaction - vendor/bin/behat -fprogress --strict - vendor/bin/behat -fprogress --profile=drupal${DRUPAL_VERSION} --strict diff --git a/features/bootstrap/FeatureContext.php b/features/bootstrap/FeatureContext.php index a55ea861..41f92eda 100644 --- a/features/bootstrap/FeatureContext.php +++ b/features/bootstrap/FeatureContext.php @@ -107,12 +107,12 @@ public function afterUserCreate(EntityScope $scope) { * @Transform table:name,mail,street,city,postcode,country */ public function castUsersTable(TableNode $user_table) { - $aliases = [ + $aliases = array( 'country' => 'field_post_address:country', 'city' => 'field_post_address:locality', 'street' => 'field_post_address:thoroughfare', 'postcode' => 'field_post_address:postal_code', - ]; + ); // The first row of the table contains the field names. $table = $user_table->getTable(); diff --git a/src/Drupal/DrupalExtension/Context/RawDrupalContext.php b/src/Drupal/DrupalExtension/Context/RawDrupalContext.php index 2e779d08..cdff0950 100644 --- a/src/Drupal/DrupalExtension/Context/RawDrupalContext.php +++ b/src/Drupal/DrupalExtension/Context/RawDrupalContext.php @@ -285,7 +285,7 @@ public function nodeCreate($node) { */ public function parseEntityFields($entity_type, \stdClass $entity) { $multicolumn_field = ''; - $multicolumn_fields = []; + $multicolumn_fields = array(); foreach ($entity as $field => $field_value) { // Reset the multicolumn field if the field name does not contain a column. @@ -312,12 +312,12 @@ public function parseEntityFields($entity_type, \stdClass $entity) { $field_name = $multicolumn_field ?: $field; if ($this->getDriver()->isField($entity_type, $field_name)) { // Split up multiple values in multi-value fields. - $values = []; + $values = array(); foreach (explode(', ', $field_value) as $key => $value) { $columns = $value; // Split up field columns if the ' - ' separator is present. if (strstr($value, ' - ') !== FALSE) { - $columns = []; + $columns = array(); foreach (explode(' - ', $value) as $column) { // Check if it is an inline named column. if (!$is_multicolumn && strpos($column, ': ', 1) !== FALSE) {