public function PanelsStorageTest::testSaveSuccessful in Panels 8.4
Same name and namespace in other branches
- 8.3 tests/src/Unit/PanelsStorageTest.php \Drupal\Tests\panels\Unit\PanelsStorageTest::testSaveSuccessful()
@covers ::save
File
- tests/
src/ Unit/ PanelsStorageTest.php, line 100
Class
- PanelsStorageTest
- Tests the PageManagerPanelsStorage service.
Namespace
Drupal\Tests\panels\UnitCode
public function testSaveSuccessful() {
$test_config = [
'my_config' => '123',
];
$this->panelsDisplay
->setConfiguration($test_config)
->shouldBeCalledTimes(1);
$this->pageVariant
->save()
->shouldBeCalledTimes(1);
$this->storage
->load('id_exists')
->willReturn($this->pageVariant
->reveal());
$panels_display = $this
->prophesize(PanelsDisplayVariant::class);
$panels_display
->getStorageId()
->willReturn('id_exists');
$panels_display
->getConfiguration()
->willReturn($test_config);
$panels_storage = new PageManagerPanelsStorage([], '', [], $this->entityTypeManager
->reveal());
$panels_storage
->save($panels_display
->reveal());
}