Commit 7c79e1c4 authored by webchick's avatar webchick

Issue #2329765 by tim.plunkett | sun: Remove all @backup* annotations from (pure) unit tests.

parent cc87280b
......@@ -16,7 +16,6 @@
/**
* @coversDefaultClass \Drupal\Core\Form\FormCache
* @group Form
* @backupStaticAttributes enabled
*/
class FormCacheTest extends UnitTestCase {
......@@ -75,6 +74,8 @@ class FormCacheTest extends UnitTestCase {
protected function setUp() {
parent::setUp();
$this->resetSafeMarkup();
$this->moduleHandler = $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface');
$this->formCacheStore = $this->getMock('Drupal\Core\KeyValueStore\KeyValueStoreExpirableInterface');
......@@ -94,6 +95,14 @@ protected function setUp() {
$this->formCache = new FormCache($this->keyValueExpirableFactory, $this->moduleHandler, $this->account, $this->csrfToken);
}
/**
* {@inheritdoc}
*/
protected function tearDown() {
parent::tearDown();
$this->resetSafeMarkup();
}
/**
* @covers ::getCache
*/
......@@ -397,4 +406,13 @@ public function testSetCacheWithSafeStrings() {
$this->formCache->setCache($form_build_id, $form, $form_state);
}
/**
* Ensures SafeMarkup does not bleed from one test to another.
*/
protected function resetSafeMarkup() {
$property = (new \ReflectionClass('Drupal\Component\Utility\SafeMarkup'))->getProperty('safeStrings');
$property->setAccessible(TRUE);
$property->setValue(array());
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment