diff --git a/src/PHPSpec/Runner/Formatter/FormatterAbstract.php b/src/PHPSpec/Runner/Formatter/FormatterAbstract.php index d21c26084..989fcef0f 100644 --- a/src/PHPSpec/Runner/Formatter/FormatterAbstract.php +++ b/src/PHPSpec/Runner/Formatter/FormatterAbstract.php @@ -39,7 +39,7 @@ abstract class FormatterAbstract implements Formatter * update the output * * @param SplSubject $method - * @param unknown $reporterEvent + * @param PHPSpec\Runnner\ReporterEvent $reporterEvent */ public function update(\SplSubject $method, $reporterEvent = null) { diff --git a/src/PHPSpec/Runner/Formatter/Junit.php b/src/PHPSpec/Runner/Formatter/Junit.php index cb26149c0..42a0dd0ee 100644 --- a/src/PHPSpec/Runner/Formatter/Junit.php +++ b/src/PHPSpec/Runner/Formatter/Junit.php @@ -16,24 +16,23 @@ * @package PHPSpec * @copyright Copyright (c) 2007-2009 Pádraic Brady, Travis Swicegood * @copyright Copyright (c) 2010-2011 Pádraic Brady, Travis Swicegood, - * Marcello Duarte + * Marcello Duarte * @license http://www.gnu.org/licenses/lgpl-3.0.txt GNU Lesser General Public Licence Version 3 - * - * - - - - - - -*/ + */ namespace PHPSpec\Runner\Formatter; -use PHPSpec\Util\Backtrace, PHPSpec\Specification\Result\DeliberateFailure, PHPSpec\Runner\Reporter; + +use PHPSpec\Util\Backtrace, + PHPSpec\Specification\Result\DeliberateFailure, + PHPSpec\Runner\Reporter; + +/** + * @category PHPSpec + * @package PHPSpec + * @copyright Copyright (c) 2007-2009 Pádraic Brady, Travis Swicegood + * @copyright Copyright (c) 2010-2011 Pádraic Brady, Travis Swicegood, + * Marcello Duarte + * @license http://www.gnu.org/licenses/lgpl-3.0.txt GNU Lesser General Public Licence Version 3 + */ class Junit extends Progress { @@ -51,12 +50,16 @@ class Junit extends Progress private $_total = 0; private $_complete = 0; private $_errorOnExit = false; - + + /** + * Creates the formatter adding a testsuites root to the xml + */ public function __construct (Reporter $reporter) { parent::__construct($reporter); $this->_xml = new \SimpleXMLElement(""); } + /** * Prints the report in a specific format */ @@ -70,7 +73,9 @@ public function output () /** * Opens the testsuite tag - * @see PHPSpec\Runner\Formatter\FormatterAbstract::_startRenderingExampleGroup() + * @see FormatterAbstract::_startRenderingExampleGroup() + * + * @param PHPSpec\Runnner\ReporterEvent $reporterEvent */ protected function _startRenderingExampleGroup($reporterEvent) { @@ -79,6 +84,9 @@ protected function _startRenderingExampleGroup($reporterEvent) $this->_currentGroup = $reporterEvent->example; } + /** + * Finishes rendering an example group + */ protected function _finishRenderingExampleGroup() { $output = ' _complete = 0; } + /** + * Render examples + * + * @param PHPSpec\Runnner\ReporterEvent $reporterEvent + */ protected function _renderExamples($reporterEvent) { $this->_total++; @@ -125,7 +138,9 @@ protected function _renderExamples($reporterEvent) $this->_complete++; break; case '*': - $error = ' ' . PHP_EOL; + $error = ' '; + $error .= PHP_EOL; $error .= ' Skipped Test: ' . $reporterEvent->example; $error .= ' ' . $reporterEvent->message; $error .= ' '; @@ -138,8 +153,10 @@ protected function _renderExamples($reporterEvent) $this->_errors++; break; case 'E': - $error = ' ' . PHP_EOL; - $error .= ' ' . $reporterEvent->example . '(FAILED)' . PHP_EOL; + $error = ' ' . PHP_EOL; + $error .= ' ' . $reporterEvent->example . '(FAILED)'; + $error .= PHP_EOL; $error .= ' ' . $reporterEvent->message . PHP_EOL; $error .= ' ' . $reporterEvent->backtrace . PHP_EOL; $error .= $this->getCode($reporterEvent->exception) . PHP_EOL; @@ -154,9 +171,11 @@ protected function _renderExamples($reporterEvent) $this->_errors++; break; case 'F': - $error = ' ' . PHP_EOL; + $error = ' ' . PHP_EOL; - $error .= ' ' . $reporterEvent->example . '(FAILED)' . PHP_EOL; + $error .= ' ' . $reporterEvent->example . '(FAILED)'; + $error .= PHP_EOL; $error .= ' ' . $reporterEvent->message . PHP_EOL; $error .= ' ' . $reporterEvent->backtrace . PHP_EOL; $error .= $this->getCode($reporterEvent->exception) . PHP_EOL; @@ -202,15 +221,16 @@ protected function getCode($e) } /** - * Cleans and returns a line. Removes php tag added to make highlight-string - * work + * Cleans and returns a line. Removes php tag added to make + * highlight-string work * - * @param unknown_type $traceline - * @param unknown_type $relativePosition - * @param unknown_type $style - * @return Ambigous + * @param array $traceline + * @param integer $relativePosition + * @param string $style + * @return string */ - protected function getLine($traceline, $relativePosition, $style = 'normal') + protected function getLine($traceline, $relativePosition, + $style = 'normal') { $code = Backtrace::readLine( $traceline['file'], @@ -228,13 +248,23 @@ protected function _onExit() } /** + * Creates a testcase + * + * @param \SimpleXMLElement $suite + * @param string $name + * @param string $class + * @param string $file + * @param integer $line + * @param string $assertions + * @param integer $executionTime + * * @return SimpleXMLElement * */ - private function createCase (\SimpleXMLElement $suite, $name, $class, $file, - $line, $assertions, $executionTime) + private function createCase (\SimpleXMLElement $suite, $name, $class, + $file, $line, $assertions, $executionTime) { $child = $suite->addChild('testcase'); $child->addAttribute('name', $name); @@ -245,7 +275,10 @@ private function createCase (\SimpleXMLElement $suite, $name, $class, $file, $child->addAttribute('executionTime', $executionTime); return $child; } + /** + * Creates suite + * * @param $name * @param $file * @param $testcount @@ -253,13 +286,14 @@ private function createCase (\SimpleXMLElement $suite, $name, $class, $file, * @param $failures * @param $errors * @param $executionTime + * * @return SimpleXMLElement * */ private function createSuite ($name, $file, $testcount, $assertions, - $failures, $errors, $executionTime) + $failures, $errors, $executionTime) { $testSuite = $this->_xml->addChild("testsuite"); $testSuite->addAttribute("name", $name); diff --git a/src/PHPSpec/Specification/Interceptor/ArrayVal.php b/src/PHPSpec/Specification/Interceptor/ArrayVal.php index 11d1b92f3..c460cd401 100644 --- a/src/PHPSpec/Specification/Interceptor/ArrayVal.php +++ b/src/PHPSpec/Specification/Interceptor/ArrayVal.php @@ -32,7 +32,7 @@ * @license http://www.gnu.org/licenses/lgpl-3.0.txt GNU Lesser General Public Licence Version 3 */ class ArrayVal extends Interceptor implements \ArrayAccess -{ +{ /** * Checks whether actual value has a key *