• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Yoast / PHPUnit-Polyfills / 16579531037

28 Jul 2025 08:25PM UTC coverage: 63.368% (-32.5%) from 95.846%
16579531037

push

github

jrfnl
Merge branch '1.x' into 2.x

365 of 576 relevant lines covered (63.37%)

17.41 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Polyfills/ExpectExceptionObject.php
1
<?php
2

3
namespace Yoast\PHPUnitPolyfills\Polyfills;
4

5
use Exception;
6

7
/**
8
 * Polyfill the TestCase::expectExceptionObject() method.
9
 *
10
 * Introduced in PHPUnit 6.4.0.
11
 *
12
 * @link https://github.com/sebastianbergmann/phpunit/pull/2780
13
 *
14
 * @since 0.1.0
15
 */
16
trait ExpectExceptionObject {
17

18
        /**
19
         * Set expectations for an expected Exception based on an Exception object.
20
         *
21
         * @param Exception $exception Exception object.
22
         *
23
         * @return void
24
         */
25
        final public function expectExceptionObject( Exception $exception ) {
×
26
                $this->expectException( \get_class( $exception ) );
×
27
                $this->expectExceptionMessage( $exception->getMessage() );
×
28
                $this->expectExceptionCode( $exception->getCode() );
×
29
        }
30
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc