\PHPUnit_Util_Log_JSON
A TestListener that generates JSON messages.
- Author: Sebastian Bergmann <sebastian@phpunit.de>
- Copyright: 2001-2014 Sebastian Bergmann <sebastian@phpunit.de>
- License: http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License
Synopsis
- // members
- protected string $currentTestSuiteName;
- protected string $currentTestName;
- protected boolean $currentTestPass;
- // Inherited members from PHPUnit_Util_Printer
- protected boolean $autoFlush;
- protected resource $out;
- protected string $outTarget;
- protected boolean $printsHTML;
- // methods
- public void addError()
- public void addFailure()
- public void addIncompleteTest()
- public void addRiskyTest()
- public void addSkippedTest()
- public void startTestSuite()
- public void endTestSuite()
- public void startTest()
- public void endTest()
- protected void writeCase()
- public void write()
- // Inherited methods from PHPUnit_Util_Printer
- public void __construct()
- public void flush()
- public void incrementalFlush()
- public void write()
- public boolean getAutoFlush()
- public void setAutoFlush()
Hierarchy
Members
protected
- $autoFlush
—
boolean
If true, flush output after every write. - $currentTestName — string
- $currentTestPass — boolean
- $currentTestSuiteName — string
- $out — resource
- $outTarget — string
- $printsHTML — boolean
Methods
protected
public
- addError() — An error occurred.
- addFailure() — A failure occurred.
- addIncompleteTest() — Incomplete test.
- addRiskyTest() — Risky test.
- addSkippedTest() — Skipped test.
- endTest() — A test ended.
- endTestSuite() — A testsuite ended.
- startTest() — A test started.
- startTestSuite() — A testsuite started.
- write()
Inherited from PHPUnit_Util_Printer
public
- flush() — Flush buffer, optionally tidy up HTML, and close output if it's not to a php stream
- getAutoFlush() — Check auto-flush mode.
- incrementalFlush() — Performs a safe, incremental flush.
- setAutoFlush() — Set auto-flushing mode.
- write()
History
-
2014-08-12T06:43:31+02:00 (commit #50dfaba)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
phpcbf --standard=PSR2 src tests
-
2014-04-30T00:06:05+02:00 (commit #a1b15f0)
Author: jeroendedauw (jeroendedauw@gmail.com) / Commiter: jeroendedauw (jeroendedauw@gmail.com)
Fix some method signature docs
-
2014-02-14T18:31:32+01:00 (commit #e5b50bc)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Next version will be 4.0
-
2014-01-30T13:44:12+01:00 (commit #bd1028b)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
More work on making PHPUnit 3.8 compatible with PHP 5.3.3
-
2014-01-22T19:43:07+01:00 (commit #02b42d7)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Initial work on formatting code according to PSR-2
-
2014-01-20T17:21:13+01:00 (commit #3a5808f)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Cleanup
-
2014-01-09T08:11:47+01:00 (commit #205e008)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Bump copyright year
-
2014-01-07T14:37:15+01:00 (commit #991bf00)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Revert "Next stable release will be PHPUnit 4" This reverts commit f4ee7815d1bb1664786fe95b226a3def20f24aa9.
-
2014-01-06T09:05:08+01:00 (commit #f4ee781)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Next stable release will be PHPUnit 4
-
2014-01-03T10:56:51+01:00 (commit #5fa6726)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Introduce new test classification: risky test
-
2013-11-05T09:11:41+01:00 (commit #1a3f574)
Author: andig (cpuidle@gmx.de) / Commiter: andig (cpuidle@gmx.de)
Update JSON.php Fix #1042
-
2013-06-27T11:55:21+02:00 (commit #1eb9164)
Author: Jeff Welch (whatthejeff@gmail.com) / Commiter: Jeff Welch (whatthejeff@gmail.com)
Cleanup and changelog for #948.
-
2013-06-27T11:34:29+02:00 (commit #4104f5d)
Author: bobrik (ibobrik@gmail.com) / Commiter: bobrik (ibobrik@gmail.com)
Do not die on binary output with json logging
-
2013-01-07T11:37:52+01:00 (commit #c517984)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Bump copyright year
-
2012-09-24T06:47:44+02:00 (commit #81ab540)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Do not perform string replacement for @package_version@ anymore.
-
2012-09-19T11:52:00+02:00 (commit #75c8e2c)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Remove workarounds for PHP < 5.4.
-
2012-05-27T14:12:42+02:00 (commit #76a561e)
Author: Volker Dusch (github@wallbash.com) / Commiter: Volker Dusch (github@wallbash.com)
Revert "Merge pull request #572 from mgb/excluded_tests_testlistener" This reverts commit 3b5d59a5d341f9b851ea373a31beb1cdc4b10ccb, reversing changes made to 063359e67e2031ba2ab9afdeb1bd6855c90987e4.
-
2012-05-20T19:52:08+02:00 (commit #67876c2)
Author: Ryan Murphy (git@minegoboom.com) / Commiter: Mine GO BOOM (git@minegoboom.com)
Quick hack to make ResultPrinter.php include excluded tests in its output. I choose to use an underscore as the output as we would want to have the total percentage complete to end up with 100%. If instead we would call writeProgress(NULL) and not have it output anything nor increment $this->column, it would cause the total summary to continue to increment. That does have the side effect where if you hit a chunk of excluded tests, your counter may go from 122/1300 to 553/1300 on the following line with no real indication of why. Another option I thought of was to instead cause the total number of tests counter to decrement, but that also looks weird if you go from 120/1500 (8%) to 160/800 (20%). But in the case when you exclude large chunks, it would prevent lots of useless output.
-
2012-04-30T12:02:38+02:00 (commit #5786e50)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
List The BSD 3-Clause License correctly and consistently. Thanks to Christian Aistleitner <christian@quelltextlich.at> for bringing this issue to my attention.
-
2012-01-01T11:21:16+01:00 (commit #aae6c38)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Bump copyright year.
-
2011-12-28T21:49:11+01:00 (commit #02f2b8a)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Add support for JSON_PRETTY_PRINT (added in PHP 5.4).
-
2011-12-20T17:08:34+01:00 (commit #ea0f300)
Author: Volker Dusch (github@wallbash.com) / Commiter: Volker Dusch (github@wallbash.com)
Fix phpcs issues
-
2011-12-20T13:00:57+01:00 (commit #cb05fe5)
Author: Volker Dusch (github@wallbash.com) / Commiter: Volker Dusch (github@wallbash.com)
Fixes #443: JSON Log now properly includes the output after it was removed in 3.6. I've used this way of implementing it to keep BC issues to a minimum. Only the output is now properly json encoded and kept with the test instead of being output afterwards inbetween the json strings as this could be an issue while parsing.
-
2011-11-10T13:59:25+01:00 (commit #81ea47f)
Author: Volker Dusch (github@wallbash.com) / Commiter: Volker Dusch (github@wallbash.com)
Reverted 66e70c5a12 as this is a feature and 3.6 is closed for features. It will stay be included in 3.7
-
2011-11-10T11:49:31+01:00 (commit #66e70c5)
Author: Volker Dusch (github@wallbash.com) / Commiter: Volker Dusch (github@wallbash.com)
Show stacktraces and messages in JSON output for skipped and incomplete tests. Closes #377
-
2011-10-04T11:18:25+02:00 (commit #bda58e6)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Fix arguments in call to PHPUnit_Util_Filter::getFilteredStacktrace().
-
2011-10-04T11:15:35+02:00 (commit #9a270a0)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Closes issue #362.
-
2011-01-25T08:24:47+01:00 (commit #2b7f44f)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Do not use PHP_CodeCoverage blacklist for PHPUnit stacktrace filtering.
-
2010-12-31T11:45:34+01:00 (commit #bee3344)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Bump copyright year.
-
2010-07-07T12:42:23+02:00 (commit #f0d9cdd)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Change email address.
-
2010-06-12T20:25:54+02:00 (commit #d19a737)
Author: Mark Story (mark@mark-story.com) / Commiter: Mark Story (mark@mark-story.com)
Removing trailing whitespace from files. Refs #1063
-
2010-06-02T18:31:15+02:00 (commit #91910b9)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Send JSON message for "test start" event.
-
2010-06-02T18:26:32+02:00 (commit #040e89c)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Simplify.
-
2010-04-05T17:41:26+02:00 (commit #471d69e)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Add @subpackage annotation.
-
2010-02-02T14:14:29+01:00 (commit #bc1aaaa)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Remove closing PHP tags.
-
2010-01-22T10:04:21+01:00 (commit #3426f50)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Require PHP 5.2.7.
-
2010-01-19T09:39:03+01:00 (commit #fb48a69)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Initial work on autoloading.
-
2009-12-31T09:26:09+01:00 (commit #37f75ff)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Bump copyright year.
-
2009-12-31T09:25:53+01:00 (commit #bddcc5f)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Bump copyright year.
-
2009-12-31T09:23:37+01:00 (commit #7a7d0b7)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Bump copyright year.
-
2009-12-25T10:32:26+01:00 (commit #60e7125)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Remove Subversion keywords.
-
2009-12-25T10:30:57+01:00 (commit #42294ad)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Remove Subversion keywords.
-
2009-12-25T10:26:35+01:00 (commit #8617133)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Remove Subversion keywords.
-
2009-11-23T09:39:24+01:00 (commit #1503412)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Merge [5389].
-
2009-11-23T09:29:23+01:00 (commit #4c9cf4e)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Initial work on PHP_CodeCoverage migration.
-
2009-08-18T17:25:30+02:00 (commit #5629d77)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Revert [5056].
-
2009-08-01T15:36:29+02:00 (commit #fc96f21)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Require PHP 5.2.10.
-
2008-12-31T10:26:51+01:00 (commit #a899cb2)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Merge [4402].
-
2008-12-31T10:25:57+01:00 (commit #4b26cea)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Bump copyright year.
-
2008-11-22T18:21:09+01:00 (commit #8d51633)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Remove deprecated functionality: --log-graphviz, --log-metrics, --log-pmd. Require PHP 5.3.0 (or later) and remove compatibility workarounds for older versions of PHP. Rename PHPUnit_Util_Class::getClassesInFile() and PHPUnit_Util_Class::getFunctionsInFile() to PHPUnit_Util_File::getClassesInFile() and PHPUnit_Util_File::getFunctionsInFile(), respectively.
-
2008-06-08T14:22:29+02:00 (commit #191a5d5)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Merge [3160].
-
2008-06-08T14:03:37+02:00 (commit #9d9b5e3)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Drop superfluous annotations.
-
2007-12-26T19:11:55+01:00 (commit #1bba1cc)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Bump copyright year.
-
2007-12-26T19:11:04+01:00 (commit #58121cf)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Bump copyright year.
-
2007-12-13T15:40:43+01:00 (commit #711e61e)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Merge [1776], close #310.
-
2007-11-28T09:30:14+01:00 (commit #49cadc5)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Drop userland JSON encoding.
-
2007-11-28T09:27:40+01:00 (commit #92d3bc1)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Refactor $filterPHPUnit method argument into a class variable and disable the filtering of PHPUnit's source files when PHPUnit's test suite is running. Migrate TestConfiguration.php to XML configuration file.
-
2007-09-29T12:56:13+02:00 (commit #8feea89)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Merge [1361].
-
2007-03-15T06:57:46+01:00 (commit #d2186ad)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Fix #107.
-
2007-03-15T06:57:46+01:00 (commit #e28bcf8)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Fix #107.
-
2007-02-24T07:58:18+01:00 (commit #203ee10)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Fugbix typo.
-
2007-02-24T07:58:18+01:00 (commit #ae2a7c2)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Fugbix typo.
-
2006-12-24T18:50:40+01:00 (commit #0189be1)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Bump year.
-
2006-11-08T14:24:54+01:00 (commit #604fb61)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Consistently use lowercase "array".
-
2006-11-07T09:21:25+01:00 (commit #92b762c)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Fix.
-
2006-11-06T14:03:12+01:00 (commit #c52cea1)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Add time to JSON messages.
-
2006-11-06T13:48:58+01:00 (commit #62ffb2d)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
More work on time.
-
2006-11-06T13:14:17+01:00 (commit #24d5d8d)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Unify timing code.
-
2006-11-05T17:31:34+01:00 (commit #9615be8)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
More work on the JSON logger.
-
2006-11-05T13:52:10+01:00 (commit #39ed35a)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Send a JSON message when a test suite starts executing that contains the number of tests.
-
2006-11-05T11:23:53+01:00 (commit #242d6a8)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Log_Eclipse -> Log_JSON
-
2006-09-11T09:20:41+02:00 (commit #75e12fb)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
No longer needed.
-
2006-07-06T11:50:42+02:00 (commit #dacd2f1)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Leftover: PHPUnit2 -> PHPUnit.
-
2006-06-30T10:38:41+02:00 (commit #210b621)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Make it easier to use a checkout of the trunk.
-
2006-06-29T20:56:08+02:00 (commit #6b0d2d5)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Post-PEAR cleanup, phase one: PHPUnit2_* -> PHPUnit_*, pear.php.net -> phpunit.de, etc.
-
2006-06-29T16:58:01+02:00 (commit #8b8c705)
Author: Sebastian Bergmann (sb@sebastian-bergmann.de) / Commiter: Sebastian Bergmann (sb@sebastian-bergmann.de)
Recreate trunk.