mirror of
https://github.com/filp/whoops.git
synced 2026-09-05 06:57:29 +00:00
Merge pull request #459 from luismulinari/feature/add-tests
Added some tests
This commit is contained in:
@@ -438,6 +438,15 @@ class RunTest extends TestCase
|
||||
$this->assertEquals(500, $run->sendHttpCode());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Whoops\Run::sendHttpCode
|
||||
*/
|
||||
public function testSendHttpCodeNullCode()
|
||||
{
|
||||
$run = $this->getRunInstance();
|
||||
$this->assertEquals(false, $run->sendHttpCode(null));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Whoops\Run::sendHttpCode
|
||||
* @expectedException InvalidArgumentException
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/**
|
||||
* Whoops - php errors for cool kids
|
||||
* @author Filipe Dobreira <http://github.com/filp>
|
||||
*/
|
||||
|
||||
namespace Whoops\Util;
|
||||
|
||||
use Whoops\TestCase;
|
||||
|
||||
class HtmlDumperOutputTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @covers Whoops\Util::__invoke
|
||||
* @covers Whoops\Util::getOutput
|
||||
*/
|
||||
public function testOutput()
|
||||
{
|
||||
$htmlDumperOutput = new HtmlDumperOutput();
|
||||
$htmlDumperOutput('first line', 0);
|
||||
$htmlDumperOutput('second line', 2);
|
||||
|
||||
$expectedOutput = <<<string
|
||||
first line
|
||||
second line
|
||||
|
||||
string;
|
||||
|
||||
$this->assertSame($expectedOutput, $htmlDumperOutput->getOutput());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Whoops\Util::clear
|
||||
*/
|
||||
public function testClear()
|
||||
{
|
||||
$htmlDumperOutput = new HtmlDumperOutput();
|
||||
$htmlDumperOutput('first line', 0);
|
||||
$htmlDumperOutput('second line', 2);
|
||||
$htmlDumperOutput->clear();
|
||||
|
||||
$this->assertNull($htmlDumperOutput->getOutput());
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,7 @@ use Whoops\TestCase;
|
||||
class TemplateHelperTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @var Whoops\Util\TemplateHelper
|
||||
* @var TemplateHelper
|
||||
*/
|
||||
private $helper;
|
||||
|
||||
@@ -63,6 +63,17 @@ class TemplateHelperTest extends TestCase
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Whoops\Util\TemplateHelper::breakOnDelimiter
|
||||
*/
|
||||
public function testBreakOnDelimiter()
|
||||
{
|
||||
$this->assertSame(
|
||||
'<div class="delimiter">abc</div>-<div class="delimiter">123</div>-<div class="delimiter">456</div>',
|
||||
$this->helper->breakOnDelimiter('-', 'abc-123-456')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Whoops\Util\TemplateHelper::slug
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user