/**
  * @test
  * @return void
  * @covers \Magento\Theme\Model\Design\Backend\Exceptions::beforeSave
  * @covers \Magento\Theme\Model\Design\Backend\Exceptions::_composeRegexp
  * @covers \Magento\Theme\Model\Design\Backend\Exceptions::_isRegexp
  * @covers \Magento\Theme\Model\Design\Backend\Exceptions::__construct
  */
 public function testBeforeSave()
 {
     $value = ['__empty' => '', 'test' => ['search' => '1qwe', 'value' => '#val#', 'regexp' => '[a-zA-Z0-9]*']];
     $this->designMock->expects($this->once())->method('setDesignTheme')->with('#val#', Area::AREA_FRONTEND);
     $this->model->setValue($value);
     $this->model->beforeSave();
 }
 /**
  * @var array $value
  * @expectedException \Magento\Framework\Exception\LocalizedException
  * @dataProvider saveWrongExceptionDataProvider
  * @magentoDbIsolation enabled
  */
 public function testSaveWrongException($value)
 {
     $this->_model->setValue($value);
     $this->_model->save();
 }
Example #3
0
 public function testAfterLoad()
 {
     $this->model->setValue([['value' => 'value', 'search' => 'qwe', 'record_id' => 1]]);
     $this->model->afterLoad();
     $this->assertEquals([['value' => 'value', 'search' => 'qwe']], $this->model->getValue());
 }