本文整理汇总了PHP中InvalidArgumentException::getLine方法的典型用法代码示例。如果您正苦于以下问题:PHP InvalidArgumentException::getLine方法的具体用法?PHP InvalidArgumentException::getLine怎么用?PHP InvalidArgumentException::getLine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类InvalidArgumentException
的用法示例。
在下文中一共展示了InvalidArgumentException::getLine方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testCreateWithExceptionWithPrevious
/**
* Log events also take an exception as message argument (here with previous exception)
*/
public function testCreateWithExceptionWithPrevious()
{
$logEvent = LogEvent::create(ILogger::LEVEL_ERROR, $this->invargEx, array(), 'PHPUnit');
$logEventData = $logEvent->getArrayCopy();
$this->assertNotEmpty($logEventData);
$this->assertInternalType('array', $logEventData);
$this->assertArrayHasKey('msg', $logEventData);
$this->assertArrayHasKey('exception', $logEventData);
$this->assertEquals($this->invargEx->getMessage(), $logEventData['msg']);
$this->assertNotEmpty($logEventData['exception']);
$this->assertInternalType('array', $logEventData['exception']);
$exceptionArray = $logEventData['exception'];
$this->assertArrayHasKey('file', $exceptionArray);
$this->assertArrayHasKey('message', $exceptionArray);
$this->assertArrayHasKey('code', $exceptionArray);
$this->assertArrayHasKey('line', $exceptionArray);
$this->assertArrayHasKey('trace', $exceptionArray);
$this->assertArrayHasKey('previous', $exceptionArray);
$this->assertEquals(__FILE__, $exceptionArray['file']);
$this->assertEquals($this->invargEx->getMessage(), $exceptionArray['message']);
$this->assertEquals($this->invargEx->getCode(), $exceptionArray['code']);
$this->assertEquals($this->invargEx->getLine(), $exceptionArray['line']);
$this->assertNotEmpty($exceptionArray['trace']);
$previousArray = $exceptionArray['previous'];
$this->assertArrayHasKey('file', $previousArray);
$this->assertArrayHasKey('message', $previousArray);
$this->assertArrayHasKey('code', $previousArray);
$this->assertArrayHasKey('line', $previousArray);
$this->assertArrayHasKey('trace', $previousArray);
$this->assertArrayNotHasKey('previous', $previousArray);
$this->assertEquals(__FILE__, $previousArray['file']);
$this->assertEquals($this->runtimeEx->getMessage(), $previousArray['message']);
$this->assertEquals($this->runtimeEx->getCode(), $previousArray['code']);
$this->assertEquals($this->runtimeEx->getLine(), $previousArray['line']);
$this->assertNotEmpty($previousArray['trace']);
}