Permalink
Browse files

Added some additional service message information

  • Loading branch information...
1 parent 1f9a725 commit 0e1d32d1e8c2dea87fffdd9940ca66248f92674a @maartenba committed Dec 28, 2012
Showing with 7 additions and 4 deletions.
  1. +7 −4 phpunit-tc.php
View
@@ -8,7 +8,6 @@ public static function printEvent($eventName, $params = array())
{
self::printText("\n##teamcity[$eventName");
foreach ($params as $key => $value) {
- //self::printText(" ");
self::printText(" $key='$value'");
}
self::printText("]\n");
@@ -128,12 +127,13 @@ public function startTest(PHPUnit_Framework_Test $test)
{
$testName = $test->getName();
$params = array(
- "name" => $testName
+ "name" => $testName,
+ "captureStandardOutput" => "true"
);
if ($test instanceof PHPUnit_Framework_TestCase) {
$className = get_class($test);
$fileName = self::getFileName($className);
- $params['locationHint'] = "php_qn://$fileName::\\$className::$testName";
+ $params['locationHint'] = "file://$fileName::\\$className::$testName";
@alexanderilyin
alexanderilyin Feb 5, 2013

locationHint — I can't find documentation for that param. What it does?

@maartenba
maartenba Feb 10, 2013 Owner

Should be pointing out the filename / class / test name

}
self::printEvent("testStarted", $params);
}
@@ -157,7 +157,7 @@ public function startTestSuite(PHPUnit_Framework_TestSuite $suite)
);
if (class_exists($suiteName, false)) {
$fileName = self::getFileName($suiteName);
- $params['locationHint'] = "php_qn://$fileName::\\$suiteName";
+ $params['locationHint'] = "file://$fileName::\\$suiteName";
}
self::printEvent("testSuiteStarted", $params);
}
@@ -187,11 +187,14 @@ public static function main($exit = TRUE)
protected function handleArguments(array $argv)
{
parent::handleArguments($argv);
+
+ // Add listener which reports to TeamCity using service messages
$this->arguments['listeners'][] = new TeamCity_PHPUnit_Framework_TestListener();
}
protected function createRunner()
{
+ // Disable coverage on the current file
$coverage_Filter = new PHP_CodeCoverage_Filter();
$coverage_Filter->addFileToBlacklist(__FILE__);
$runner = new PHPUnit_TextUI_TestRunner($this->arguments['loader'], $coverage_Filter);

0 comments on commit 0e1d32d

Please sign in to comment.