mirror of
https://github.com/maximebf/php-debugbar.git
synced 2025-07-27 19:50:21 +02:00
27 lines
854 B
PHP
27 lines
854 B
PHP
<?php
|
|
|
|
namespace DebugBar\Tests\ServerHandler;
|
|
|
|
use DebugBar\Tests\DebugBarTestCase;
|
|
use DebugBar\ServerHandler\FrontController;
|
|
|
|
class FrontControllerTest extends DebugBarTestCase
|
|
{
|
|
public function testRegisterHandler()
|
|
{
|
|
$fc = new FrontController($this->debugbar);
|
|
$fc->registerHandler(new MockHandler());
|
|
$this->assertTrue($fc->isHandlerRegistered('mock'));
|
|
}
|
|
|
|
public function testHandle()
|
|
{
|
|
$fc = new FrontController($this->debugbar);
|
|
$fc->registerHandler($m = new MockHandler());
|
|
|
|
$this->assertEquals('"pong"', $fc->handle(array('hdl' => 'debugbar', 'op' => 'ping'), false, false));
|
|
$this->assertEquals('{"ping":"pong"}', $fc->handle(array('hdl' => 'mock', 'op' => 'ping', 'param' => 'val'), false, false));
|
|
$this->assertArrayHasKey('param', $m->calls[0]);
|
|
}
|
|
}
|