/** * @covers ::get() */ public function testGet() { $this->keyValue->expects($this->at(0))->method('get')->with('test_2')->will($this->returnValue(FALSE)); $this->keyValue->expects($this->at(1))->method('get')->with('test')->will($this->returnValue($this->ownObject)); $this->assertNull($this->tempStore->get('test_2')); $this->assertSame($this->ownObject->data, $this->tempStore->get('test')); }
/** * Form submission handler for the Preview button. */ public function submitPreview($form, FormStateInterface $form_state) { // Rebuild the form with a pristine $view object. $view = $this->entity; // Attempt to load the view from temp store, otherwise create a new one. if (!($new_view = $this->tempStore->get($view->id()))) { $new_view = new ViewUI($view); } $form_state['build_info']['args'][0] = $new_view; $form_state['show_preview'] = TRUE; $form_state['rebuild'] = TRUE; }