public function PanelsStorageTest::testSaveNotPanels in Panels 8.3
Same name and namespace in other branches
- 8.4 tests/src/Unit/PanelsStorageTest.php \Drupal\Tests\panels\Unit\PanelsStorageTest::testSaveNotPanels()
@covers ::save
@expectedException \Exception @expectedExceptionMessage Page variant doesn't use a Panels display variant
File
- tests/
src/ Unit/ PanelsStorageTest.php, line 146 - Contains \Drupal\Tests\panels\Unit\PanelsStorageTest.
Class
- PanelsStorageTest
- Tests the PageManagerPanelsStorage service.
Namespace
Drupal\Tests\panels\UnitCode
public function testSaveNotPanels() {
$this->storage
->load('not_a_panel')
->willReturn($this->pageVariantNotPanels
->reveal());
$this->panelsDisplay
->setConfiguration(Argument::cetera())
->shouldNotBeCalled();
$this->pageVariant
->save()
->shouldNotBeCalled();
$panels_display = $this
->prophesize(PanelsDisplayVariant::class);
$panels_display
->getStorageId()
->willReturn('not_a_panel');
$panels_display
->getConfiguration()
->shouldNotBeCalled();
$panels_storage = new PageManagerPanelsStorage([], '', [], $this->entityTypeManager
->reveal());
$panels_storage
->save($panels_display
->reveal());
}