src/Logging/JUnit/Reader.php
protected function caseNodesToSuiteProperties(array $nodeArray, array &$testCases = [])
    {
        $cb = [TestCase::class, 'caseFromNode'];

        return array_reduce($nodeArray, function ($result, $c) use (&$testCases, $cb) {
            $testCases[] = \call_user_func_array($cb, [$c]);
            $result['name'] = (string) $c['class'];
            $result['file'] = (string) $c['file'];
            ++$result['tests'];
            $result['assertions'] += (int) $c['assertions'];
            $result['failures'] += \count($c->xpath('failure'));
            $result['errors'] += \count($c->xpath('error'));
            $result['skipped'] += \count($c->xpath('skipped'));
            $result['time'] += (float) $c['time'];

            return $result;
        }, static::$defaultSuite);
    }
protected function caseNodesToSuiteProperties(array $nodeArray, array &$testCases = [])
    {
        $cb = [TestCase::class, 'caseFromNode'];

        return array_reduce($nodeArray, function ($result, $c) use (&$testCases, $cb) {
            $testCases[] = \call_user_func_array($cb, [$c]);
            $result['name'] = (string) $c['class'];
            $result['file'] = (string) $c['file'];
            ++$result['tests'];
            $result['assertions'] += (int) $c['assertions'];
            $result['failures'] += \count($c->xpath('failure'));
            $result['errors'] += \count($c->xpath('error'));
            $result['skipped'] += \count($c->xpath('skipped'));
            $result['time'] += (float) $c['time'];

            return $result;
        }, static::$defaultSuite);
    }
protected function caseNodesToSuiteProperties ( array $ nodeArray , array & $ testCases = [ ] ) { $ cb = [ TestCase :: class , 'caseFromNode' ] ; return array_reduce ( $ nodeArray , function ( $ result , $ c ) use ( & $ testCases , $ cb ) { $ testCases [ ] = \ call_user_func_array ( $ cb , [ $ c ] ) ; $ result [ 'name' ] = ( string ) $ c [ 'class' ] ; $ result [ 'file' ] = ( string ) $ c [ 'file' ] ; ++ $ result [ 'tests' ] ; $ result [ 'assertions' ] += ( int ) $ c [ 'assertions' ] ; $ result [ 'failures' ] += \ count ( $ c -> xpath ( 'failure' ) ) ; $ result [ 'errors' ] += \ count ( $ c -> xpath ( 'error' ) ) ; $ result [ 'skipped' ] += \ count ( $ c -> xpath ( 'skipped' ) ) ; $ result [ 'time' ] += ( float ) $ c [ 'time' ] ; return $ result ; } , static :: $ defaultSuite ) ; }
Fold an array of testcase nodes into a suite array.

@param array $nodeArray an array of testcase nodes
@param array $testCases an array reference. Individual testcases will be placed here.

@return mixed
Fold an array of testcase nodes into a suite array .