forked from PHPMailer/PHPMailer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show debug log only when tests fail (PHPMailer#1161)
- Loading branch information
Showing
5 changed files
with
51 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
/** | ||
* PHPMailer - language file tests. | ||
* | ||
* PHP version 5.5. | ||
* | ||
* @author Marcus Bointon <phpmailer@synchromedia.co.uk> | ||
* @author Andy Prevost | ||
* @copyright 2010 - 2017 Marcus Bointon | ||
* @copyright 2004 - 2009 Andy Prevost | ||
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License | ||
*/ | ||
|
||
namespace PHPMailer\Test; | ||
|
||
class DebugLogTestListener extends \PHPUnit_Framework_BaseTestListener | ||
{ | ||
private static $debugLog = ''; | ||
|
||
public function addError(\PHPUnit_Framework_Test $test, \Exception $e, $time) | ||
{ | ||
echo self::$debugLog; | ||
} | ||
|
||
public function addFailure(\PHPUnit_Framework_Test $test, \PHPUnit_Framework_AssertionFailedError $e, $time) | ||
{ | ||
echo self::$debugLog; | ||
} | ||
|
||
public function startTest(\PHPUnit_Framework_Test $test) | ||
{ | ||
self::$debugLog = ''; | ||
} | ||
|
||
public static function debugLog($str) | ||
{ | ||
self::$debugLog .= $str . PHP_EOL; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters