Commit 74c8c599 authored by catch's avatar catch

Issue #2502477 by alexpott: Running all the PHPUnit tests using PHPUnit results in failure

parent 7d8eb15a
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
/** /**
* @coversDefaultClass \Drupal\Core\Form\FormCache * @coversDefaultClass \Drupal\Core\Form\FormCache
* @group Form * @group Form
* @runTestsInSeparateProcesses
* @preserveGlobalState disabled
*/ */
class FormCacheTest extends UnitTestCase { class FormCacheTest extends UnitTestCase {
...@@ -94,8 +96,6 @@ class FormCacheTest extends UnitTestCase { ...@@ -94,8 +96,6 @@ class FormCacheTest extends UnitTestCase {
protected function setUp() { protected function setUp() {
parent::setUp(); parent::setUp();
$this->resetSafeMarkup();
$this->moduleHandler = $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface'); $this->moduleHandler = $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface');
$this->formCacheStore = $this->getMock('Drupal\Core\KeyValueStore\KeyValueStoreExpirableInterface'); $this->formCacheStore = $this->getMock('Drupal\Core\KeyValueStore\KeyValueStoreExpirableInterface');
...@@ -120,14 +120,6 @@ protected function setUp() { ...@@ -120,14 +120,6 @@ protected function setUp() {
$this->formCache = new FormCache($this->root, $this->keyValueExpirableFactory, $this->moduleHandler, $this->account, $this->csrfToken, $this->logger, $this->requestStack, $this->requestPolicy); $this->formCache = new FormCache($this->root, $this->keyValueExpirableFactory, $this->moduleHandler, $this->account, $this->csrfToken, $this->logger, $this->requestStack, $this->requestPolicy);
} }
/**
* {@inheritdoc}
*/
protected function tearDown() {
parent::tearDown();
$this->resetSafeMarkup();
}
/** /**
* @covers ::getCache * @covers ::getCache
*/ */
...@@ -494,13 +486,4 @@ public function testDeleteCache() { ...@@ -494,13 +486,4 @@ public function testDeleteCache() {
$this->formCache->deleteCache($form_build_id); $this->formCache->deleteCache($form_build_id);
} }
/**
* 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