public function assertThrows(
        string $class,
        callable $execute,
        callable $inspect = null
    ) : void {
        try {
            $execute();
        } catch (ExpectationFailedException $e) {
            throw $e;
        } catch (Throwable $e) {
            static::assertThat($e, new ConstraintException($class));

            if ($inspect !== null) {
                $inspect($e);
            }

            return;
        }
		
        static::assertThat(null, new ConstraintException($class));
    }
public function assertThrows(
        string $class,
        callable $execute,
        callable $inspect = null
    ) : void {
        try {
            $execute();
        } catch (ExpectationFailedException $e) {
            throw $e;
        } catch (Throwable $e) {
            static::assertThat($e, new ConstraintException($class));

            if ($inspect !== null) {
                $inspect($e);
            }

            return;
        }
		
        static::assertThat(null, new ConstraintException($class));
    }
public function assertThrows ( string $ class , callable $ execute , callable $ inspect = null ) : void { try { $ execute ( ) ; } catch ( ExpectationFailedException $ e ) { throw $ e ; } catch ( Throwable $ e ) { static :: assertThat ( $ e , new ConstraintException ( $ class ) ) ; if ( $ inspect !== null ) { $ inspect ( $ e ) ; } return ; } static :: assertThat ( null , new ConstraintException ( $ class ) ) ; }
Asserts that the callable throws a specified throwable.
If successful and the inspection callable is not null
then it is called and the caught exception is passed as argument.

@param string        $class The exception type expected to be thrown.
@param callable      $execute The callable.
@param callable|null $inspect [optional] The inspector.
@since   1.0.0
Asserts that the callable throws a specified throwable . If successful and the inspection callable is not null then it is called and the caught exception is passed as argument .