1<?php
2require_once 'PHPUnit/Framework.php';
3
4class ExceptionTest extends PHPUnit_Framework_TestCase
5{
6 public function testException()
7 {
8 $this->expectException(InvalidArgumentException::class);
9 // or for PHPUnit < 5.2
10 // $this->setExpectedException(InvalidArgumentException::class);
11
12 //...and then add your test code that generates the exception
13 exampleMethod($anInvalidArgument);
14 }
15}