Skip to content

Commit

Permalink
Issue #3130220 by focus13, fgm: Add queue driver, compatible with 9.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
fgm committed Jul 24, 2021
1 parent cb3e01e commit 8f18587
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 11 deletions.
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@
"mongodb/mongodb": "^1.5.1"
},
"require-dev": {
"phpunit/phpunit": "^9.5",
"phpspec/prophecy-phpunit": "^2",
"phpunit/phpunit": "^8.5.18",
"squizlabs/php_codesniffer": "^3.5"
},
"support": {
Expand Down
25 changes: 21 additions & 4 deletions core.phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,18 @@
<env name="SIMPLETEST_BASE_URL" value=""/>
<!-- Example SIMPLETEST_DB value: mysql://username:password@localhost/databasename#table_prefix -->
<env name="SIMPLETEST_DB" value=""/>
<!-- To have browsertest output use an alternative base URL. For example if
SIMPLETEST_BASE_URL is an internal DDEV URL, you can set this to the
external DDev URL so you can follow the links directly.
-->
<!-- Example BROWSERTEST_OUTPUT_DIRECTORY value: /path/to/webroot/sites/simpletest/browser_output -->
<env name="BROWSERTEST_OUTPUT_DIRECTORY" value=""/>
<!-- To have browsertest output use an alternative base URL. For example if
SIMPLETEST_BASE_URL is an internal DDEV URL, you can set this to the
external DDev URL so you can follow the links directly.
-->
<env name="BROWSERTEST_OUTPUT_BASE_URL" value=""/>
<!-- To disable deprecation testing completely uncomment the next line. -->
<!-- <env name="SYMFONY_DEPRECATIONS_HELPER" value="disabled"/> -->
<env name="BROWSERTEST_OUTPUT_DIRECTORY" value=""/>
<!-- To disable deprecation testing completely set SYMFONY_DEPRECATIONS_HELPER value: 'disabled' -->
<env name="SYMFONY_DEPRECATIONS_HELPER" value="weak_vendors"/>
<!-- Example for changing the driver class for mink tests MINK_DRIVER_CLASS value: 'Drupal\FunctionalJavascriptTests\DrupalSelenium2Driver' -->
<env name="MINK_DRIVER_CLASS" value=''/>
<!-- Example for changing the driver args to mink tests MINK_DRIVER_ARGS value: '["http://127.0.0.1:8510"]' -->
Expand Down Expand Up @@ -74,4 +77,18 @@
</exclude>
</whitelist>
</filter>
<!-- Filter for coverage reports. -->
<coverage>
<include>
<directory>../modules/contrib/mongodb</directory>
</include>
<exclude>
<file>../modules/contrib/mongodb/example.settings.local.php</file>
<!-- By definition test classes have no tests. -->
<directory suffix="Test.php">../modules/contrib/mongodb</directory>
<directory suffix="TestBase.php">../modules/contrib/mongodb</directory>
<!-- There is a remaining legacy test for reference in watchdog for now -->
<directory suffix=".test">../modules/contrib/mongodb</directory>
</exclude>
</coverage>
</phpunit>
4 changes: 2 additions & 2 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ guide assumes that :
10.x.
* The [mongodb][mongodb] (not [mongo][mongo]) PHP extension version 1.7 or
later is installed and configured.
* PHP is version 7.3.x to 8.0.x. PHP 8.0.x should work but is not tested: be sure
* PHP is version 7.4.x to 8.0.x. PHP 8.0.x should work but is not tested: be sure
to [report any issue][report] you could have with it.
* We recommend [using Composer](#installing-using-composer) for installing this
module.
Expand Down Expand Up @@ -93,7 +93,7 @@ $settings['mongodb'] = [
* The `logger` database alias will store logger collections on the same
`default` MongoDB server, but in a separate `logger` database.
* The `queue` database alias will store queue collections on the same
`default` MongoDB server, but in a separate `queue` database.
`default` MongoDB server, but in a separate `queue` database.

The module contains an example default implementation of these settings, which
you can copy or include, in `mongodb/example.settings.local.php`.
Expand Down
1 change: 0 additions & 1 deletion modules/mongodb_storage/tests/src/Kernel/SqlImportTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
use Drupal\mongodb_storage\KeyValueExpirableFactory;
use Drupal\mongodb_storage\KeyValueFactory;
use Drupal\mongodb_storage\Storage;
use Drupal\views\Plugin\views\query\Sql;

/**
* Tests the import for the commands.mongodb.storage.import_keyvalue command.
Expand Down
7 changes: 5 additions & 2 deletions modules/mongodb_watchdog/src/Logger.php
Original file line number Diff line number Diff line change
Expand Up @@ -750,12 +750,15 @@ public function requestTemplates($unsafeRequestId): array {

$cursor = $this
->trackerCollection()
->find($selector, static::LEGACY_TYPE_MAP + [
->find(
$selector,
static::LEGACY_TYPE_MAP + [
'projection' => [
'_id' => 0,
'template_id' => 1,
],
]);
]
);
$templateIds = [];
foreach ($cursor as $request) {
$templateIds[] = $request['template_id'];
Expand Down

0 comments on commit 8f18587

Please sign in to comment.