示例#1
0
 /**
  * @test
  * @return void
  */
 public function testBeforeSaveDelete()
 {
     $fileServiceName = 'service_name';
     $customization = $this->getMockBuilder('Magento\\Framework\\View\\Design\\Theme\\Customization\\FileInterface')->getMock();
     $this->fileServiceFactory->expects($this->once())->method('create')->with($fileServiceName)->willReturn($customization);
     $customization->expects($this->once())->method('prepareFile')->with($this->model)->willReturnSelf();
     $customization->expects($this->once())->method('save')->with($this->model)->willReturnSelf();
     $customization->expects($this->once())->method('delete')->with($this->model)->willReturnSelf();
     $this->model->setData('file_type', $fileServiceName);
     $this->model->beforeSave();
     $this->model->beforeDelete();
 }
示例#2
0
 /**
  * Test crud operations for theme files model using valid data
  */
 public function testCrud()
 {
     $this->_model->setData($this->_data);
     $crud = new \Magento\TestFramework\Entity($this->_model, ['file_path' => 'rename.css']);
     $crud->testCrud();
 }