public function testThrowUserNoticeException() { error_reporting(E_ALL); ML\E2e\ErrorHandler::stop(); // PHPUnit has own error_handler. This force ours. :) ML\E2e\ErrorHandler::run(); $this->setExpectedException('ML\E2e\UserNoticeException'); trigger_error("Custom user notice", E_USER_NOTICE); }