File "ExpectExceptionObject.php"
Full Path: /home/elegucvf/public_html/video/wp-content/plugins/one-click-demo-import/vendor/yoast/phpunit-polyfills/src/Polyfills/ExpectExceptionObject.php
File size: 675 bytes
MIME-type: text/x-php
Charset: utf-8
<?php
namespace Yoast\PHPUnitPolyfills\Polyfills;
use Exception;
/**
* Polyfill the TestCase::expectExceptionObject() method.
*
* Introduced in PHPUnit 6.4.0.
*
* @link https://github.com/sebastianbergmann/phpunit/pull/2780
*/
trait ExpectExceptionObject {
/**
* Set expectations for an expected Exception based on an Exception object.
*
* @param Exception $exception Exception object.
*
* @return void
*/
final public function expectExceptionObject( Exception $exception ) {
$this->expectException( \get_class( $exception ) );
$this->expectExceptionMessage( $exception->getMessage() );
$this->expectExceptionCode( $exception->getCode() );
}
}