public function testAggregateLogFilesWithInvalidLogFile() { $aggregator = new phpucPHPUnitTestLogAggregator(); $aggregator->aggregate($this->createBrokenFileIterator('log')); $expected = sprintf('%s/phpunit/expected-failed/log.xml', PHPUC_TEST_DATA); $result = sprintf('%s/log.xml', PHPUC_TEST_DIR); $aggregator->store($result); $this->assertXmlFileEqualsXmlFile($expected, $result); }
/** * This method executes the main merge process of this task. * * @return void * @throws phpucTaskException * If the generated test suite contains an error or a failure. This * error result is used to signal a failed build. */ public function execute() { $inputFiles = new ArrayIterator($this->inputFiles); $aggregator = new phpucPHPUnitTestLogAggregator(); $aggregator->aggregate($inputFiles); $aggregator->store($this->outputFile); if (count($this->validateErrors) > 0) { throw new phpucTaskException(implode(' ', $this->validateErrors)); } else { if ($aggregator->hasErrors() || $aggregator->hasFailures()) { throw new phpucTaskException('There are errors or failures in the generated test suite.'); } } }