diff --git a/.travis.yml b/.travis.yml index dac38dd..26a0345 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,6 @@ language: php php: - - 7.0 - - 7.1 - - 7.2 - 7.3 - 7.4 diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ebcc06..21e6f7e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +## [2.1.1] +### Fixed + * [#233](https://github.com/jhedstrom/DrupalDriver/pull/233) Prevent PHP warning in Drupal 7.79 and above. + * [#232](https://github.com/jhedstrom/DrupalDriver/pull/232) Fix type in ImageHandler. ## [2.1.0] ### Added * [#186](https://github.com/jhedstrom/DrupalDriver/issues/168) Provide a method to directly authenticate on Drupal 8. @@ -98,7 +102,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/). docblock for `CoreInterface::roleCreate`. -[Unreleased]: https://github.com/jhedstrom/DrupalDriver/compare/v2.1.0...HEAD +[Unreleased]: https://github.com/jhedstrom/DrupalDriver/compare/v2.1.1...HEAD +[2.1.1]: https://github.com/jhedstrom/DrupalDriver/compare/v2.1.0...v2.1.1 [2.1.0]: https://github.com/jhedstrom/DrupalDriver/compare/v2.0.0...v2.1.0 [2.0.0]: https://github.com/jhedstrom/DrupalDriver/compare/v2.0.0-rc1...v2.0.0 [2.0.0 rc1]: https://github.com/jhedstrom/DrupalDriver/compare/v2.0.0-alpha6...v2.0.0-rc1 diff --git a/composer.json b/composer.json index 7b94555..7aebd14 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,7 @@ "test": [ "composer validate --no-interaction", "parallel-lint src spec tests", - "phpunit --coverage-html=reports/coverage", + "phpunit", "phpspec run -f pretty --no-interaction", "phpcs --standard=./phpcs-ruleset.xml ." diff --git a/src/Drupal/Driver/Cores/Drupal6.php b/src/Drupal/Driver/Cores/Drupal6.php index b39d2f5..85bbe23 100644 --- a/src/Drupal/Driver/Cores/Drupal6.php +++ b/src/Drupal/Driver/Cores/Drupal6.php @@ -531,7 +531,7 @@ public function entityDelete($entity_type, $entity) { * {@inheritdoc} */ public function startCollectingMail() { - // @todo: create a D6 version of this function + // @todo create a D6 version of this function throw new \Exception('Mail testing is not yet implemented for Drupal 6.'); } @@ -539,7 +539,7 @@ public function startCollectingMail() { * {@inheritdoc} */ public function stopCollectingMail() { - // @todo: create a D6 version of this function + // @todo create a D6 version of this function throw new \Exception('Mail testing is not yet implemented for Drupal 6.'); } @@ -547,7 +547,7 @@ public function stopCollectingMail() { * {@inheritdoc} */ public function getMail() { - // @todo: create a D6 version of this function + // @todo create a D6 version of this function throw new \Exception('Mail testing is not yet implemented for Drupal 6.'); } @@ -555,7 +555,7 @@ public function getMail() { * {@inheritdoc} */ public function clearMail() { - // @todo: create a D6 version of this function + // @todo create a D6 version of this function throw new \Exception('Mail testing is not yet implemented for Drupal 6.'); } @@ -563,7 +563,7 @@ public function clearMail() { * {@inheritdoc} */ public function sendMail($body, $subject = '', $to = '', $langcode = '') { - // @todo: create a D6 version of this function + // @todo create a D6 version of this function throw new \Exception('Mail testing is not yet implemented for Drupal 6.'); } diff --git a/src/Drupal/Driver/Cores/Drupal7.php b/src/Drupal/Driver/Cores/Drupal7.php index c6923e9..7c8d133 100644 --- a/src/Drupal/Driver/Cores/Drupal7.php +++ b/src/Drupal/Driver/Cores/Drupal7.php @@ -533,7 +533,7 @@ public function entityDelete($entity_type, $entity) { * {@inheritdoc} */ public function startCollectingMail() { - // @todo: create a D7 version of this function + // @todo create a D7 version of this function throw new \Exception('Mail testing is not yet implemented for Drupal 7.'); } @@ -541,7 +541,7 @@ public function startCollectingMail() { * {@inheritdoc} */ public function stopCollectingMail() { - // @todo: create a D7 version of this function + // @todo create a D7 version of this function throw new \Exception('Mail testing is not yet implemented for Drupal 7.'); } @@ -549,7 +549,7 @@ public function stopCollectingMail() { * {@inheritdoc} */ public function getMail() { - // @todo: create a D7 version of this function + // @todo create a D7 version of this function throw new \Exception('Mail testing is not yet implemented for Drupal 7.'); } @@ -557,7 +557,7 @@ public function getMail() { * {@inheritdoc} */ public function clearMail() { - // @todo: create a D7 version of this function + // @todo create a D7 version of this function throw new \Exception('Mail testing is not yet implemented for Drupal 7.'); } @@ -565,7 +565,7 @@ public function clearMail() { * {@inheritdoc} */ public function sendMail($body, $subject = '', $to = '', $langcode = '') { - // @todo: create a D7 version of this function + // @todo create a D7 version of this function throw new \Exception('Mail testing is not yet implemented for Drupal 7.'); } diff --git a/src/Drupal/Driver/DrushDriver.php b/src/Drupal/Driver/DrushDriver.php index e28a6c3..2086e8a 100644 --- a/src/Drupal/Driver/DrushDriver.php +++ b/src/Drupal/Driver/DrushDriver.php @@ -275,7 +275,8 @@ public function createEntity($entity_type, \StdClass $entity) { 'entity_type' => $entity_type, 'entity' => $entity, ]; - $result = $this->drush('behat', ['create-entity', escapeshellarg(json_encode($options))], []); + $result = $this->drush('behat', + ['create-entity', escapeshellarg(json_encode($options))], []); return $this->decodeJsonObject($result); } @@ -287,7 +288,8 @@ public function entityDelete($entity_type, \StdClass $entity) { 'entity_type' => $entity_type, 'entity' => $entity, ]; - $this->drush('behat', ['delete-entity', escapeshellarg(json_encode($options))], []); + $this->drush('behat', + ['delete-entity', escapeshellarg(json_encode($options))], []); } /** @@ -301,7 +303,9 @@ public function createNode($node) { $node->uid = $uid; } } - $result = $this->drush('behat', ['create-node', escapeshellarg(json_encode($node))], []); + $result = $this->drush('behat', + ['create-node', escapeshellarg(json_encode($node))], + []); return $this->decodeJsonObject($result); } @@ -316,7 +320,11 @@ public function nodeDelete($node) { * {@inheritdoc} */ public function createTerm(\stdClass $term) { - $result = $this->drush('behat', ['create-term', escapeshellarg(json_encode($term))], []); + $result = $this->drush('behat', + [ + 'create-term', + escapeshellarg(json_encode($term)), + ], []); return $this->decodeJsonObject($result); } diff --git a/src/Drupal/Driver/Fields/Drupal8/DatetimeHandler.php b/src/Drupal/Driver/Fields/Drupal8/DatetimeHandler.php index 6250657..1a93041 100644 --- a/src/Drupal/Driver/Fields/Drupal8/DatetimeHandler.php +++ b/src/Drupal/Driver/Fields/Drupal8/DatetimeHandler.php @@ -2,8 +2,6 @@ namespace Drupal\Driver\Fields\Drupal8; -use DateTime; -use DateTimeZone; use Drupal\datetime\Plugin\Field\FieldType\DateTimeItemInterface; /** @@ -15,8 +13,8 @@ class DatetimeHandler extends AbstractHandler { * {@inheritdoc} */ public function expand($values) { - $siteTimezone = new DateTimeZone(\Drupal::config('system.date')->get('timezone.default')); - $storageTimezone = new DateTimeZone(DateTimeItemInterface::STORAGE_TIMEZONE); + $siteTimezone = new \DateTimeZone(\Drupal::config('system.date')->get('timezone.default')); + $storageTimezone = new \DateTimeZone(DateTimeItemInterface::STORAGE_TIMEZONE); foreach ($values as $key => $value) { if (strpos($value, "relative:") !== FALSE) { $relative = trim(str_replace('relative:', '', $value)); @@ -28,7 +26,7 @@ public function expand($values) { // uses UTC for internal storage. If no timezone is specified in a date // field value by the step author, assume the default timezone of // the Drupal install, and therefore transform it into UTC for storage. - $date = new DateTime($value, $siteTimezone); + $date = new \DateTime($value, $siteTimezone); $date->setTimezone($storageTimezone); $values[$key] = $date->format('Y-m-d\TH:i:s'); } diff --git a/src/Drupal/Driver/Fields/Drupal8/ImageHandler.php b/src/Drupal/Driver/Fields/Drupal8/ImageHandler.php index 15de99c..d042bfb 100644 --- a/src/Drupal/Driver/Fields/Drupal8/ImageHandler.php +++ b/src/Drupal/Driver/Fields/Drupal8/ImageHandler.php @@ -16,7 +16,7 @@ public function expand($values) { throw new \Exception("Error reading file"); } - /* @var \Drupal\file\FileInterface $file */ + /** @var \Drupal\file\FileInterface $file */ $file = file_save_data( $data, 'public://' . uniqid() . '.jpg');