Come together with the global Drupal community in Rotterdam, 28 Sept – 1 Oct 2026. Sessions, contribution, connection, and Early Bird savings until 8 June.
protected function WebTestBase::refreshVariables
8 WebTestBase.php protected WebTestBase::refreshVariables()
Refreshes in-memory configuration and state information.
Useful after a page request is made that changes configuration or state in a different thread.
In other words calling a settings page with $this->drupalPostForm() with a changed value would update configuration to reflect that change, but in the thread that made the call (thread running the test) the changed values would not be picked up.
This method clears the cache and loads a fresh copy.
Eh. It seems that logging in as a different user makes it work. Since the testcase does that anyway to visit node/add/page just a few lines later, I'll just move the login() call ahead a bit.
Comments
Comment #2
cburschkaStill need to test the plugin selection form.
Comment #5
cburschkaApparently tags don't show up in filter/tips after being disabled - UNLESS we put a particular debugging dsm() into the XBBCodeFilter constructor.
No, I don't know why.
Comment #6
cburschkaThe drupal_set_message() fixes the problem even if it's empty. I'm pretty baffled.
Comment #7
cburschkaOf course it's a caching issue. :facehoof:
Comment #8
cburschkarefreshVariables() didn't help.
Comment #10
cburschkaEh. It seems that logging in as a different user makes it work. Since the testcase does that anyway to visit node/add/page just a few lines later, I'll just move the login() call ahead a bit.
Comment #11
cburschkaTwo more parts:
1. Rename a tag.
2. Use format specific settings.
Comment #12
cburschkaRenaming should happen in the regular plugin test case.
Let's see if the testbot can handle this.
Comment #13
cburschkaHm.
Comment #14
cburschkaIs this thing on?
Comment #15
cburschkaYaaaaaaay! :D :D
Comment #18
cburschkaWell, on the bright side, it's not a bug in the test. The form really does block changing a name until you've already enabled it and saved.
Comment #19
cburschkaRetest with #2629662: Can't rename tags while enabling them.
Comment #20
cburschkaComment #25
cburschkaVariable name error.
Comment #27
cburschkaHerpaderp let's just generate a random mixed-case machine name to put into a field that requires lower-case. >_<
(Come to think of it, the validator absolutely needs to be tested too.)
Comment #28
cburschkaComment #29
cburschkaNext round:
- Form validation
- Format-specific settings.
Comment #31
cburschkaForm validation.
Comment #33
cburschkaNext: Finally, the format-specific stuff.
Comment #34
cburschkaLast one.
Comment #36
cburschkaI forgot how to drupalPostForm.
Comment #38
cburschkaAnd also forgot how to prefix the entity plugins.
Comment #40
cburschkaComment #42
cburschkaAnd done.
Comment #43
cburschka