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 answers only not deleted user 9921

Use it for questions about automated Drupal tests.

5 votes

Is it possible to write test against the current database?

The testing environment is by default completely separated from your website, so module testing is in no way affected by the environment. However you might be able to switch the database. … There is this article about testing on the live database: http://www.codesidekick.com/blog/break-out-simpletest-sandbox. …
Neograph734's user avatar
  • 8,449
2 votes
Accepted

Do Simpletests require t()?

I know for a fact (though it is probably not the only reason) that t() allows for replacement arguments: echo t('my %string', ('%string' => 'Foo')); Which renders as: 'my Foo' (emphasized text). …
Neograph734's user avatar
  • 8,449
1 vote

How to get the super user in a functional test?

Looking into BrowserTestBase I accidentally found $this->rootUser->name and $this->rootUser->pass_raw last week. These are being used in installParameters(). I have not tested it, but I suppose you sh …
Neograph734's user avatar
  • 8,449
2 votes

How to do System Tests / Functional Tests with an existing database

normal setup of a BrowserTest would look something like this: /** * {@inheritdoc} */ public function setUp() { parent::setUp(); // Create an article content type that we will use for testing
Neograph734's user avatar
  • 8,449
3 votes
Accepted

Why do functional tests require a running website?

In my experience the testing framework will install a new Drupal site for every individual test and in the end remove these sites. … This is done by creating testing tables in your existing database, for which you need to provide the credentials in SIMPLETEST_DB. …
Neograph734's user avatar
  • 8,449
1 vote
Accepted

drupalLogin in functional JavaScript tests passes locally but fails on Drupal.org?

After reading through the Jenkins results for the nth time, it finally occurred to me that during Drupal core (and other contrib) tests all JavaScript tests always run separately from the other tests. …
Neograph734's user avatar
  • 8,449
2 votes
Accepted

How to read testbot feedback / get more info

If you click the colored patch result (above), you will get to a detailed page. On the top of that page there is a link 'View results on dispatcher'. That will get you to the test. Then go to the 'C …
Neograph734's user avatar
  • 8,449