Esempio n. 1
0
 /**
  * @covers \Magento\CheckoutAgreements\Model\Agreement::validateData
  *
  * @dataProvider validateDataDataProvider
  * @param \Magento\Framework\Object $inputData
  * @param array|bool $expectedResult
  */
 public function testValidateData($inputData, $expectedResult)
 {
     $this->assertEquals($expectedResult, $this->model->validateData($inputData));
 }
Esempio n. 2
0
 /**
  * Create agreement data object based on given agreement model
  *
  * @param Agreement $agreement
  * @return AgreementDataObject
  */
 protected function createAgreementDataObject(Agreement $agreement)
 {
     $this->agreementBuilder->populateWithArray(array(AgreementDataObject::ID => $agreement->getId(), AgreementDataObject::NAME => $agreement->getName(), AgreementDataObject::CONTENT => $agreement->getContent(), AgreementDataObject::CONTENT_HEIGHT => $agreement->getContentHeight(), AgreementDataObject::CHECKBOX_TEXT => $agreement->getCheckboxText(), AgreementDataObject::ACTIVE => (bool) $agreement->getIsActive(), AgreementDataObject::HTML => (bool) $agreement->getIsHtml()));
     return $this->agreementBuilder->create();
 }