StateExceptionTest.php 816 B

1234567891011121314151617181920212223242526272829303132
  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\StateException;
  8. use Magento\Framework\Phrase;
  9. /**
  10. * Class StateExceptionTest
  11. */
  12. class StateExceptionTest extends \PHPUnit\Framework\TestCase
  13. {
  14. /**
  15. * @return void
  16. */
  17. public function testStateExceptionInstance()
  18. {
  19. $instanceClass = \Magento\Framework\Exception\StateException::class;
  20. $message = 'message %1 %2';
  21. $params = [
  22. 'parameter1',
  23. 'parameter2',
  24. ];
  25. $cause = new \Exception();
  26. $stateException = new StateException(new Phrase($message, $params), $cause);
  27. $this->assertInstanceOf($instanceClass, $stateException);
  28. }
  29. }