laraverer 3年前

修改理由:

业务没执行,就断言,是几个意思?

相关信息:


此投稿状态为 标记为已读

内容修改:

红色背景 为原始内容

绿色背景 为新增或者修改的内容

OldNewDifferences
172172   // 检查 $type 参数
173173   public function testGetWeatherWithInvalidType()
174174   {
175        $w = new Weather('mock-key');
 175       
 176
 177       $w->getWeather('深圳', 'foo');
 178       $w = new Weather('mock-key');
176179       
177180       // 断言会抛出此异常类
178181       $this->expectException(InvalidArgumentException::class);
179182       
180183       // 断言异常消息为 'Invalid type value(base/all): foo'
181184       $this->expectExceptionMessage('Invalid type value(base/all): foo');
182   
183        $w->getWeather('深圳', 'foo');  
184185
185186       $this->fail('Failed to assert getWeather throw exception with invalid argument.');
186187   }