public function expectException($exception) { //future-proofed expectException method if (method_exists(get_parent_class(), 'expectException')) { parent::expectException($exception); } else { $this->setExpectedException($exception); } }