Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
subversal
/
video
/
wp-content
/
plugins
/
one-click-demo-import
/
vendor
/
yoast
/
phpunit-polyfills
/
src
/
Polyfills
:
ExpectExceptionObject.php
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
<?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() ); } }