protected function SharedTempStoreTest::setUp in Drupal 8
Same name in this branch
- 8 core/tests/Drupal/Tests/Core/TempStore/SharedTempStoreTest.php \Drupal\Tests\Core\TempStore\SharedTempStoreTest::setUp()
- 8 core/modules/user/tests/src/Unit/SharedTempStoreTest.php \Drupal\Tests\user\Unit\SharedTempStoreTest::setUp()
Overrides UnitTestCase::setUp
File
- core/
tests/ Drupal/ Tests/ Core/ TempStore/ SharedTempStoreTest.php, line 71
Class
- SharedTempStoreTest
- @coversDefaultClass \Drupal\Core\TempStore\SharedTempStore @group TempStore
Namespace
Drupal\Tests\Core\TempStoreCode
protected function setUp() {
parent::setUp();
$this->keyValue = $this
->createMock('Drupal\\Core\\KeyValueStore\\KeyValueStoreExpirableInterface');
$this->lock = $this
->createMock('Drupal\\Core\\Lock\\LockBackendInterface');
$this->requestStack = new RequestStack();
$request = Request::createFromGlobals();
$this->requestStack
->push($request);
$this->tempStore = new SharedTempStore($this->keyValue, $this->lock, $this->owner, $this->requestStack, 604800);
$this->ownObject = (object) [
'data' => 'test_data',
'owner' => $this->owner,
'updated' => (int) $request->server
->get('REQUEST_TIME'),
];
// Clone the object but change the owner.
$this->otherObject = clone $this->ownObject;
$this->otherObject->owner = 2;
}