Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
OauthInputExceptionTest.php
Go to the documentation of this file.
1 <?php
8 
9 use \Magento\Framework\Oauth\OauthInputException;
11 
12 class OauthInputExceptionTest extends \PHPUnit\Framework\TestCase
13 {
18  {
19  $exception = new OauthInputException();
20  foreach (['field1', 'field2'] as $param) {
21  $exception->addError(
22  new Phrase('"%fieldName" is required. Enter and try again.', ['fieldName' => $param])
23  );
24  }
25  $exception->addError(new Phrase('Message with period.'));
26 
27  $this->assertEquals(
28  '"field1" is required. Enter and try again, "field2" is required. Enter and try again, Message with period',
29  $exception->getAggregatedErrorMessage()
30  );
31  }
32 
37  {
38  $exception = new OauthInputException();
39  $this->assertEquals('', $exception->getAggregatedErrorMessage());
40  }
41 }