/** * Handle the assertation that the given result object has no errors * * @param \TYPO3\FLOW3\Error\Result $result * @param boolean $expectSuccess * @return void */ protected function assertSuccess(\TYPO3\FLOW3\Error\Result $result, $expectSuccess = TRUE) { if ($expectSuccess === TRUE) { $this->assertFalse($result->hasErrors()); } else { $this->assertTrue($result->hasErrors()); } }
/** * @return boolean TRUE if the argument is valid, FALSE otherwise * @api */ public function isValid() { return !$this->validationResults->hasErrors(); }
/** * Merge the given Result object into this one. * * @param \TYPO3\FLOW3\Error\Result $otherResult * @return void * @api */ public function merge(\TYPO3\FLOW3\Error\Result $otherResult) { if ($otherResult->hasErrors()) { $this->mergeProperty($otherResult, 'getErrors', 'addError'); } if ($otherResult->hasWarnings()) { $this->mergeProperty($otherResult, 'getWarnings', 'addWarning'); } if ($otherResult->hasNotices()) { $this->mergeProperty($otherResult, 'getNotices', 'addNotice'); } foreach ($otherResult->getSubResults() as $subPropertyName => $subResult) { /** @var Result $subResult */ if ($subResult->hasErrors() || $subResult->hasWarnings() || $subResult->hasNotices()) { $this->forProperty($subPropertyName)->merge($subResult); } } }