You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
640 B
24 lines
640 B
11 years ago
|
<?php
|
||
|
namespace yiiunit\framework\base;
|
||
|
|
||
|
use yii\test\TestCase;
|
||
|
use yii\base\UserException;
|
||
|
use yii\base\InvalidCallException;
|
||
|
|
||
|
|
||
|
class ExceptionTest extends TestCase
|
||
|
{
|
||
|
public function testToArrayWithPrevious()
|
||
|
{
|
||
|
$e = new InvalidCallException('bar', 0 ,new InvalidCallException('foo'));
|
||
|
$array = $e->toArray();
|
||
|
$this->assertEquals('bar', $array['message']);
|
||
|
$this->assertEquals('foo', $array['previous']['message']);
|
||
|
|
||
|
$e = new InvalidCallException('bar', 0 ,new UserException('foo'));
|
||
|
$array = $e->toArray();
|
||
|
$this->assertEquals('bar', $array['message']);
|
||
|
$this->assertEquals('foo', $array['previous']['message']);
|
||
|
}
|
||
|
}
|