में यूनिटटेस्ट त्रुटि नियंत्रक Iam 100% कोड कवरेज का प्रशंसक है, लेकिन मुझे नहीं पता कि ज़ेंड फ्रेमवर्क में त्रुटि नियंत्रक का परीक्षण कैसे करें।ज़ेंड फ्रेमवर्क
public function testDispatchErrorAction()
{
$this->dispatch('/error/error');
$this->assertResponseCode(200);
$this->assertController('error');
$this->assertAction('error');
}
public function testDispatch404()
{
$this->dispatch('/error/errorxxxxx');
$this->assertResponseCode(404);
$this->assertController('error');
$this->assertAction('error');
}
लेकिन यह कैसे एक आवेदन त्रुटि (500) के लिए परीक्षण करने के लिए:
यह 404Action और errorAction परीक्षण करने के लिए कोई समस्या नहीं है? शायद मुझे ऐसा कुछ चाहिए?
public function testDispatch500()
{
throw new Exception('test');
$this->dispatch('/error/error');
$this->assertResponseCode(500);
$this->assertController('error');
$this->assertAction('error');
}