Skip to content

Commit

Permalink
Remove usage of display_error.
Browse files Browse the repository at this point in the history
  • Loading branch information
fpoirotte committed Oct 1, 2014
1 parent 19be2af commit c318405
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 19 deletions.
6 changes: 0 additions & 6 deletions src/Formatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,12 +264,6 @@ protected function formatTime(
*/
protected function formatException(\Exception $exception)
{
// Don't display exceptions unless display_errors
// is set to "On" (which ini_get() returns as "1").
if (!((int) ini_get("display_errors"))) {
return false;
}

if (!$this->pythonLike) {
$s = (string) $exception;
if (substr($s, -1) == "\n") {
Expand Down
14 changes: 1 addition & 13 deletions tests/unit/FormatterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,17 +177,6 @@ public function testFormatTime2()
*/
public function testFormatException()
{
ini_set('display_errors', 0);
$exc = new \Exception('');
$this->assertFalse($this->formatter->formatExceptionStub($exc));
}

/**
* @covers \Plop\Formatter::formatException
*/
public function testFormatException2()
{
ini_set('display_errors', 1);
$exc = new \Plop\Exception('Foo');
$line = __LINE__ - 1;
$file = __FILE__;
Expand All @@ -202,9 +191,8 @@ public function testFormatException2()
/**
* @covers \Plop\Formatter::formatException
*/
public function testFormatException3()
public function testFormatException2()
{
ini_set('display_errors', 1);
$this->formatter->setPythonLike(true);
$exc = new \Plop\Exception('Foo');
$line = __LINE__ - 1;
Expand Down

0 comments on commit c318405

Please sign in to comment.