public function testGetConfigIfContentIsNotHtml()
 {
     $content = 'content';
     $escapedContent = 'escaped_content';
     $checkboxText = 'checkbox_text';
     $mode = \Magento\CheckoutAgreements\Model\AgreementModeOptions::MODE_AUTO;
     $agreementId = 100;
     $expectedResult = ['checkoutAgreements' => ['isEnabled' => 1, 'agreements' => [['content' => $escapedContent, 'checkboxText' => $checkboxText, 'mode' => $mode, 'agreementId' => $agreementId]]]];
     $this->scopeConfigMock->expects($this->once())->method('isSetFlag')->with(AgreementsProvider::PATH_ENABLED, ScopeInterface::SCOPE_STORE)->willReturn(true);
     $agreement = $this->getMock('\\Magento\\CheckoutAgreements\\Api\\Data\\AgreementInterface');
     $this->agreementsRepositoryMock->expects($this->any())->method('getList')->willReturn([$agreement]);
     $this->escaperMock->expects($this->once())->method('escapeHtml')->with($content)->willReturn($escapedContent);
     $agreement->expects($this->once())->method('getIsHtml')->willReturn(false);
     $agreement->expects($this->once())->method('getContent')->willReturn($content);
     $agreement->expects($this->once())->method('getCheckboxText')->willReturn($checkboxText);
     $agreement->expects($this->once())->method('getMode')->willReturn($mode);
     $agreement->expects($this->once())->method('getAgreementId')->willReturn($agreementId);
     $this->assertEquals($expectedResult, $this->model->getConfig());
 }
 /**
  * @dataProvider getConfigDataProvider
  * @param bool $isAgreementsEnabled
  * @param array $agreements
  * @param array $expectedResult
  */
 public function testGetConfig($isAgreementsEnabled, $agreements, $expectedResult)
 {
     $this->scopeConfigMock->expects($this->once())->method('isSetFlag')->with(AgreementsProvider::PATH_ENABLED, ScopeInterface::SCOPE_STORE)->willReturn($isAgreementsEnabled);
     $this->agreementsRepositoryMock->expects($this->any())->method('getList')->willReturn($agreements);
     $this->assertEquals($expectedResult, $this->model->getConfig());
 }