Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
redis
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
redis
Commits
ab81caa3
Commit
ab81caa3
authored
11 months ago
by
Sascha Grossenbacher
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3425760
: implement QueueFactoryInterface
parent
481fc171
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!28
enable next minor/major testing
Pipeline
#194285
canceled
11 months ago
Stage: build
Stage: validate
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Queue/QueueRedisFactory.php
+9
-1
9 additions, 1 deletion
src/Queue/QueueRedisFactory.php
tests/src/Functional/WebTest.php
+14
-1
14 additions, 1 deletion
tests/src/Functional/WebTest.php
with
23 additions
and
2 deletions
src/Queue/QueueRedisFactory.php
+
9
−
1
View file @
ab81caa3
...
...
@@ -2,13 +2,21 @@
namespace
Drupal\redis\Queue
;
use
Drupal\Core\Queue\QueueFactoryInterface
;
use
Drupal\Core\Site\Settings
;
use
Drupal\redis\ClientFactory
;
// BC for Drupal core 10.1 and earlier.
if
(
!
interface_exists
(
QueueFactoryInterface
::
class
))
{
interface
BCQueueFactoryInterface
{
}
class_alias
(
BCQueueFactoryInterface
::
class
,
QueueFactoryInterface
::
class
);
}
/**
* Defines the queue factory for the Redis backend.
*/
class
QueueRedisFactory
{
class
QueueRedisFactory
implements
QueueFactoryInterface
{
/**
* Queue implementation class namespace prefix.
...
...
This diff is collapsed.
Click to expand it.
tests/src/Functional/WebTest.php
+
14
−
1
View file @
ab81caa3
...
...
@@ -5,6 +5,7 @@ namespace Drupal\Tests\redis\Functional;
use
Drupal\Component\Utility\OpCodeCache
;
use
Drupal\Core\Database\Database
;
use
Drupal\Core\Site\Settings
;
use
Drupal\cron_queue_test
\Plugin\QueueWorker\CronQueueTestException
;
use
Drupal\Tests\BrowserTestBase
;
use
Drupal\Tests\field_ui
\Traits\FieldUiTestTrait
;
use
Drupal\Tests\redis\Traits\RedisTestInterfaceTrait
;
...
...
@@ -24,7 +25,7 @@ class WebTest extends BrowserTestBase {
*
* @var array
*/
protected
static
$modules
=
[
'redis'
,
'block'
];
protected
static
$modules
=
[
'redis'
,
'block'
,
'cron_queue_test'
];
/**
* {@inheritdoc}
...
...
@@ -196,6 +197,18 @@ class WebTest extends BrowserTestBase {
$this
->
clickLink
(
$update
[
'title[0][value]'
]);
$this
->
assertSession
()
->
responseContains
(
$edit
[
'body[0][value]'
]);
// Manually add a queue item and process it, to test the queue factory.
// Get the queue to test the normal Exception.
$queue
=
\Drupal
::
queue
(
CronQueueTestException
::
PLUGIN_ID
);
// Enqueue an item for processing.
$queue
->
createItem
([
$this
->
randomMachineName
()
=>
$this
->
randomMachineName
()]);
// Run cron; the worker for this queue should throw an exception and handle
// it.
\Drupal
::
service
(
'cron'
)
->
run
();
$this
->
assertEquals
(
1
,
\Drupal
::
state
()
->
get
(
'cron_queue_test_exception'
));
// Get database schema.
$db_schema
=
Database
::
getConnection
()
->
schema
();
$this
->
assertFalse
(
$db_schema
->
tableExists
(
'cache_default'
));
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment