AuthorizationExceptionTest.php 767 B

123456789101112131415161718192021222324252627
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Framework\Exception\Test\Unit;
  7. use \Magento\Framework\Exception\AuthorizationException;
  8. use Magento\Framework\Phrase;
  9. class AuthorizationExceptionTest extends \PHPUnit\Framework\TestCase
  10. {
  11. /**
  12. * @return void
  13. */
  14. public function testConstructor()
  15. {
  16. $authorizationException = new AuthorizationException(
  17. new Phrase(
  18. 'The consumer isn\'t authorized to access %resources.',
  19. ['consumer_id' => 1, 'resources' => 'record2']
  20. )
  21. );
  22. $this->assertSame("The consumer isn't authorized to access record2.", $authorizationException->getMessage());
  23. }
  24. }