Skip to content

Commit 46a7bb0

Browse files
committed
MAGETWO-31999: oAuth issue [from github]
- Unit test for OauthInputException::getAggregatedErrorMessage
1 parent 9ecf277 commit 46a7bb0

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
/**
3+
* @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com)
4+
*/
5+
namespace Magento\Framework\Oauth;
6+
7+
class OauthInputExceptionTest extends \PHPUnit_Framework_TestCase
8+
{
9+
public function testGetAggregatedErrorMessage()
10+
{
11+
$exception = new OauthInputException();
12+
foreach (['field1', 'field2'] as $param) {
13+
$exception->addError(OauthInputException::REQUIRED_FIELD, ['fieldName' => $param]);
14+
}
15+
$exception->addError('Message with period.', ['fieldName' => 'field3']);
16+
17+
$this->assertEquals(
18+
'field1 is a required field, field2 is a required field, Message with period',
19+
$exception->getAggregatedErrorMessage()
20+
);
21+
}
22+
23+
public function testGetAggregatedErrorMessageNoError()
24+
{
25+
$exception = new OauthInputException();
26+
$this->assertEquals('', $exception->getAggregatedErrorMessage());
27+
}
28+
}

0 commit comments

Comments
 (0)