mirror of
https://github.com/filp/whoops.git
synced 2026-09-04 06:32:25 +00:00
37 lines
934 B
PHP
37 lines
934 B
PHP
<?php
|
|
/**
|
|
* Whoops - php errors for cool kids
|
|
* @author Filipe Dobreira <http://github.com/filp>
|
|
*/
|
|
|
|
namespace Whoops\Util;
|
|
|
|
use Whoops\TestCase;
|
|
|
|
class MiscTest extends TestCase
|
|
{
|
|
/**
|
|
* @dataProvider provideTranslateException
|
|
* @param string $expected_output
|
|
* @param int $exception_code
|
|
*/
|
|
public function testTranslateException($expected_output, $exception_code)
|
|
{
|
|
$output = Misc::translateErrorCode($exception_code);
|
|
$this->assertEquals($expected_output, $output);
|
|
}
|
|
|
|
public function provideTranslateException()
|
|
{
|
|
return array(
|
|
// When passing an error constant value, ensure the error constant
|
|
// is returned.
|
|
array('E_USER_WARNING', E_USER_WARNING),
|
|
|
|
// When passing a value not equal to an error constant, ensure
|
|
// E_UNKNOWN is returned.
|
|
array('E_UNKNOWN', 3),
|
|
);
|
|
}
|
|
}
|