Skip to content

Commit

Permalink
Merge pull request #234 from jhedstrom/prep/2.1.1
Browse files Browse the repository at this point in the history
Prep/2.1.1

Signed-off-by: Jonathan Hedstrom <[email protected]>
  • Loading branch information
jhedstrom committed May 7, 2021
1 parent 1af83d9 commit a33cb76
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 25 deletions.
3 changes: 0 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
language: php

php:
- 7.0
- 7.1
- 7.2
- 7.3
- 7.4

Expand Down
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 ."

Expand Down
10 changes: 5 additions & 5 deletions src/Drupal/Driver/Cores/Drupal6.php
Original file line number Diff line number Diff line change
Expand Up @@ -531,39 +531,39 @@ 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.');
}

/**
* {@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.');
}

/**
* {@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.');
}

/**
* {@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.');
}

/**
* {@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.');
}

Expand Down
10 changes: 5 additions & 5 deletions src/Drupal/Driver/Cores/Drupal7.php
Original file line number Diff line number Diff line change
Expand Up @@ -533,39 +533,39 @@ 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.');
}

/**
* {@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.');
}

/**
* {@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.');
}

/**
* {@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.');
}

/**
* {@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.');
}

Expand Down
16 changes: 12 additions & 4 deletions src/Drupal/Driver/DrushDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -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))], []);
}

/**
Expand All @@ -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);
}

Expand All @@ -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);
}

Expand Down
8 changes: 3 additions & 5 deletions src/Drupal/Driver/Fields/Drupal8/DatetimeHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace Drupal\Driver\Fields\Drupal8;

use DateTime;
use DateTimeZone;
use Drupal\datetime\Plugin\Field\FieldType\DateTimeItemInterface;

/**
Expand All @@ -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));
Expand All @@ -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');
}
Expand Down
2 changes: 1 addition & 1 deletion src/Drupal/Driver/Fields/Drupal8/ImageHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit a33cb76

Please sign in to comment.