convertTestCaseToSimpletestRow example


  public static function xmlElementToRows($test_id, \SimpleXMLElement $element) {
    $records = [];
    $test_cases = static::findTestCases($element);
    foreach ($test_cases as $test_case) {
      $records[] = static::convertTestCaseToSimpletestRow($test_id$test_case);
    }
    return $records;
  }

  /** * Finds all test cases recursively from a test suite list. * * @param \SimpleXMLElement $element * The PHPUnit xml to search for test cases. * @param \SimpleXMLElement $parent * (Optional) The parent of the current element. Defaults to NULL. * * @return array * A list of all test cases. * * @internal */
EOD;
    $simpletest = [
      'test_id' => 23,
      'test_class' => 'Drupal\Tests\simpletest\Unit\TestDiscoveryTest',
      'status' => 'pass',
      'message' => '',
      'message_group' => 'Other',
      'function' => 'Drupal\Tests\simpletest\Unit\TestDiscoveryTest->testGetTestClasses()',
      'line' => 108,
      'file' => '/Users/paul/projects/drupal/core/modules/simpletest/tests/src/Unit/TestDiscoveryTest.php',
    ];
    $this->assertEquals($simpletest, JUnitConverter::convertTestCaseToSimpletestRow(23, new \SimpleXMLElement($junit)));
  }

}
Home | Imprint | This part of the site doesn't use cookies.