Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options questions only not deleted user 5147

Use it for questions about automated Drupal tests.

1 vote
1 answer
37 views

How do I block a user/cancel a user account in Simpletest?

I'm trying to write some tests for a module for situations in which a user is blocked. I know I can use drupalCreateUser() to make new users, but how do I block a user I have created in Simpletest?
Patrick Kenny's user avatar
4 votes
1 answer
44 views

How do I re-queue a test that has been postponed on Drupal.org?

I'm trying to run the tests on a patch on Drupal.org. The relevant issue is here. The status is marked as Test request sent but more than a week has passed and the test hasn't been run. I tried cha …
Patrick Kenny's user avatar
1 vote
1 answer
2k views

How to avoid "Access to an undefined property" with text field format in PHPStan?

I have a text field that I am setting inside an entity bundle. protected function doSomethingAwesome(string $value): void { $this->set('field_text', $value); $this->field_text->format = 'spe …
Patrick Kenny's user avatar
3 votes
1 answer
189 views

How do I set the PHP version for a contrib module with GitLab CI?

I'm trying to set up testing using the GitLab template for contrib modules. In the module's composer.json, PHP 8.2 is required, and since the CI is currently defaulting to 8.1, the install fails. …
Patrick Kenny's user avatar
0 votes
1 answer
61 views

Contrib module phpstan on Gitlab CI: How to make dependency modules available?

I have a module Decoupled Passkeys that adds JSON-RPC module endpoints, so it depends on JSON-RPC. When I run tests with a custom phpstan.neon, I'm getting a lot of errors because phpstan cannot find …
Patrick Kenny's user avatar
3 votes
1 answer
45 views

How do I write a test for a specific server (nginx) for Drupal.org?

Normally, when I test my own code, the server is whatever type of server I am testing; there is no way to specify a server. … Does the Drupal.org testing infrastructure have a way to test with a specific type of server? If so, how can I do that? …
Patrick Kenny's user avatar
2 votes
2 answers
339 views

How do I enable a PHP extension on GitLab CI?

I'm trying to use Drupal.org's GitLab CI to test a module that has a dependency on a package that requires PHP's ext-sodium to be installed: No composer.lock file present. Updating dependencies to lat …
Patrick Kenny's user avatar
1 vote
1 answer
26 views

Kernel module install test failure: FieldException: Field 'uid' on entity type 'file' refere...

I'm trying to add a really simple module install/uninstall test: <?php namespace Drupal\Tests\jsonapi_include\Kernel; use Drupal\KernelTests\KernelTestBase; /** * Test installation and uninstallat …
Patrick Kenny's user avatar
2 votes
2 answers
996 views

How do I set the value of a date and time field with Behat?

I am trying to test my site with Behat. On my entity edit form, I have a Datetime field that uses the Date and time widget. I want to use the Date and time widget because I need to set the time in in …
Patrick Kenny's user avatar
2 votes
1 answer
415 views

How do I test a CKEditor 4 text format field with Behat/Mink?

I am using an @javascript test in Behat on CircleCI to check my Drupal 8 site. When I use the standard I fill in "my field" with "value" step, it works for fields with the plain text format, but it fa …
Patrick Kenny's user avatar
0 votes
1 answer
569 views

How do I test a CKEditor 5 text format field with Behat/Mink?

Drupal 10 is switching from CKEditor 4 to 5. So, I installed the experimental CKEditor 5 module and am attempting to update my Behat tests to use CKEditor 5. I am using an @javascript test in Behat on …
Patrick Kenny's user avatar
0 votes
1 answer
48 views

How to use GitLab CI to test submodules that have different dependencies than the parent mod...

I have created a contrib module that adds an entity type. I then created a submodule that adds a JSON-RPC endpoint to enable creating entities of the parent module using JSON-RPC. This submodule depen …
Patrick Kenny's user avatar
1 vote
0 answers
29 views

Is there a way to use the dev versions of other Drupal modules in GitLab CI but stable as th...

(dev when testing, stable when installing) …
Patrick Kenny's user avatar
1 vote
1 answer
309 views

How do I write a behat test to go to user/UID/somewhere when I only know the username?

I'm trying to write Behat tests to verify my Drupal Commerce store. My test creates some users, so I know the usernames but not the UIDs (the UIDs are assigned by Drupal in the test, so they will be d …
Patrick Kenny's user avatar
0 votes
3 answers
619 views

How can I automatically restore my site from a backup using the command line for testing pur...

I am on Mac OS X using MAMP PRO as my local development environment. I want to quickly reset my site to a known state in order to run some tests I have prepared in Selenium. I have the Backup and Mi …
Patrick Kenny's user avatar