Upgraded to PSR-4 autoloading

This commit is contained in:
Ben Ramsey
2014-02-21 18:35:01 -06:00
parent 8569983a11
commit c43be02bd9
22 changed files with 4 additions and 4 deletions
+49
View File
@@ -0,0 +1,49 @@
<?php
namespace Rhumsaa\Uuid\Console\Util;
use Rhumsaa\Uuid\Console\TestCase;
class ErrorHandlerTest extends TestCase
{
/**
* @covers Rhumsaa\Uuid\Console\Util\ErrorHandler::register
*/
public function testRegister()
{
$expected = array (
'Rhumsaa\\Uuid\Console\\Util\\ErrorHandler',
'handle',
);
$originalHandler = set_error_handler(function () {});
ErrorHandler::register();
$testHandler = set_error_handler(function () {});
// Set handler back to original
set_error_handler($originalHandler);
$this->assertEquals($expected, $testHandler);
}
/**
* @covers Rhumsaa\Uuid\Console\Util\ErrorHandler::handle
* @expectedException ErrorException
* @expectedExceptionMessage Test exception
*/
public function testHandle()
{
error_reporting(E_ALL);
ErrorHandler::handle(1, 'Test exception', __FILE__, __LINE__);
}
/**
* @covers Rhumsaa\Uuid\Console\Util\ErrorHandler::handle
*/
public function testHandleNoException()
{
error_reporting(0);
$this->assertEmpty(ErrorHandler::handle(1, 'Test exception', __FILE__, __LINE__));
}
}