PHPUnit注释引发ReflectionException:类不存在
我正在尝试使用phpUnit注释捕获异常:PHPUnit注释引发ReflectionException:类不存在,php,phpunit,Php,Phpunit,我正在尝试使用phpUnit注释捕获异常: /** * @expectedException Drupal\apple_news\Api\Exception\ApiException. */ public function testDecodeResponse() { $this->client->decodeResponse(''); } 看起来还可以,事实上,如果我使用setExpectedException,效果很好,但我得到: ReflectionException:
/**
* @expectedException Drupal\apple_news\Api\Exception\ApiException.
*/
public function testDecodeResponse() {
$this->client->decodeResponse('');
}
看起来还可以,事实上,如果我使用setExpectedException,效果很好,但我得到:
ReflectionException: Class Drupal\apple_news\Api\Exception\ApiException. does not exist
知道为什么会这样吗
谢谢。去掉一个点
/**
* @expectedException Drupal\apple_news\Api\Exception\ApiException // <- here
*/
/**
*@expectedException Drupal\apple\u news\Api\Exception\apieexception//啊,说真的,我现在觉得自己真的很愚蠢:-D.谢谢你,伙计