|
| addCase (SimpleXMLElement $xml_parent_node, string $id, string $title, string $preconditions, string $steps, string $expected,) |
|
| initUISection () |
|
| addComponentCases (SimpleXMLElement $xml_parent_node, string $section, string $component_name, ComponentEntry $entry,) |
|
| getTemplate () |
|
| getBlockContents (string $block) |
|
| getClickpath (ComponentEntry $entry) |
|
| getCaseId (string $component_path, string $subkey) |
|
| getExpectedExamples (array $examples) |
|
Definition at line 26 of file TestRailXMLWriter.php.
◆ __construct()
Definition at line 44 of file TestRailXMLWriter.php.
49 $this->xml =
new SimpleXMLElement(
'<?xml version="1.0"?><sections></sections>');
50 foreach (self::$CASEIDS as $k => $v) {
51 $this->no_expexted_ids += count($v);
52 $this->expected_by_caseids = array_merge($this->expected_by_caseids, array_values($v));
◆ addCase()
TestRailXMLWriter::addCase |
( |
SimpleXMLElement |
$xml_parent_node, |
|
|
string |
$id, |
|
|
string |
$title, |
|
|
string |
$preconditions, |
|
|
string |
$steps, |
|
|
string |
$expected |
|
) |
| |
|
protected |
Definition at line 101 of file TestRailXMLWriter.php.
Referenced by addComponentCases(), and initUISection().
109 $xml_case = $xml_parent_node->addChild(
'case');
110 $xml_case->addChild(
'id',
$id);
111 $xml_case->addChild(
'title', $title);
112 $xml_case->addChild(
'template',
'Test Case');
113 $xml_case->addChild(
'type',
'Other');
114 $xml_case->addChild(
'priority',
'4 - Must Test');
115 $xml_cust = $xml_case->addChild(
'custom');
116 $xml_cust->addChild(
'preconds',
"\n" . trim($preconditions) .
"\n");
117 $xml_cust->addChild(
'steps',
"\n" . trim($steps) .
"\n");
118 $xml_cust->addChild(
'expected',
"\n" . trim($expected) .
"\n");
119 return $xml_parent_node;
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
◆ addComponentCases()
TestRailXMLWriter::addComponentCases |
( |
SimpleXMLElement |
$xml_parent_node, |
|
|
string |
$section, |
|
|
string |
$component_name, |
|
|
ComponentEntry |
$entry |
|
) |
| |
|
protected |
Definition at line 157 of file TestRailXMLWriter.php.
References addCase(), getBlockContents(), getCaseId(), getClickpath(), ILIAS\UI\Implementation\Crawler\Entry\ComponentEntry\getExamples(), getExpectedExamples(), getTemplate(), and ILIAS\UI\Implementation\Crawler\Entry\ComponentEntry\getTitle().
Referenced by withData().
166 list($build, $case_id) = $this->
getCaseId($section .
'/' . $component_name, self::SHOW);
169 $steps->setCurrentBlock(
'steps_show');
170 $steps->setVariable(
'SECTION', $section);
171 $steps->setVariable(
'CLICKPATH', $this->
getClickpath($entry));
172 $steps->setVariable(
'TITLE', $entry->
getTitle());
173 $steps->parseCurrentBlock();
174 $steps = $steps->get();
178 $expected->setVariable(
'EXAMPLE_COUNTER', (
string) count($entry->
getExamples()));
179 $expected->setVariable(
'EXPECTED', $expected_examples);
180 $expected = $expected->get();
184 $section .
' - ' . $component_name .
': ' . self::SHOW,
191 list($build, $case_id) = $this->
getCaseId($section .
'/' . $component_name, self::VALIDATE);
194 $steps->setCurrentBlock(
'steps_validate');
195 $steps->setVariable(
'SECTION', $section);
196 $steps->setVariable(
'CLICKPATH', $this->
getClickpath($entry));
197 $steps->setVariable(
'TITLE', $entry->
getTitle());
198 $steps->parseCurrentBlock();
199 $steps = $steps->get();
206 $section .
' - ' . $component_name .
': ' . self::VALIDATE,
getBlockContents(string $block)
getCaseId(string $component_path, string $subkey)
getExpectedExamples(array $examples)
getClickpath(ComponentEntry $entry)
addCase(SimpleXMLElement $xml_parent_node, string $id, string $title, string $preconditions, string $steps, string $expected,)
◆ addSection()
TestRailXMLWriter::addSection |
( |
SimpleXMLElement |
$xml_parent_node, |
|
|
string |
$name, |
|
|
string |
$description = '' |
|
) |
| |
Definition at line 90 of file TestRailXMLWriter.php.
Referenced by initUISection().
95 $xml_section = $xml_parent_node->addChild(
'section');
96 $xml_section->addChild(
'name', $name);
97 $xml_section->addChild(
'description', $description);
◆ getBlockContents()
TestRailXMLWriter::getBlockContents |
( |
string |
$block | ) |
|
|
protected |
◆ getCaseId()
TestRailXMLWriter::getCaseId |
( |
string |
$component_path, |
|
|
string |
$subkey |
|
) |
| |
|
protected |
Definition at line 233 of file TestRailXMLWriter.php.
Referenced by addComponentCases(), and initUISection().
236 if (array_key_exists($component_path, self::$CASEIDS)
237 && array_key_exists($subkey, self::$CASEIDS[$component_path])
239 $case_id = self::$CASEIDS[$component_path][$subkey];
240 $this->no_found_ids += 1;
241 print
"\n caseId for: $component_path ($subkey)";
243 $this->expected_by_caseids[
244 array_search($case_id, $this->expected_by_caseids)
248 $this->no_new_ids += 1;
249 print
"\n no caseId for: $component_path ($subkey)";
252 $build = ($case_id ===
'' && $this->only_new_cases)
253 || ($case_id !==
'' && !$this->only_new_cases);
255 return [$build, $case_id];
◆ getClickpath()
◆ getExpectedExamples()
TestRailXMLWriter::getExpectedExamples |
( |
array |
$examples | ) |
|
|
protected |
Definition at line 258 of file TestRailXMLWriter.php.
Referenced by addComponentCases().
261 foreach (array_keys($examples) as $idx => $example) {
262 $expected_show = $expected_show .
"\n**" . $idx + 1 .
'. ' . ucfirst(str_replace(
'_',
' ', $example)) .
'**';
263 $docs = $this->parser->parseYamlStringArrayFromFile($examples[$example]);
264 if (array_key_exists(
'expected output', $docs)) {
265 $expected_show .=
"\n" . $docs[
'expected output'] .
"\n";
268 return $expected_show;
◆ getTemplate()
TestRailXMLWriter::getTemplate |
( |
| ) |
|
|
protected |
◆ getXML()
TestRailXMLWriter::getXML |
( |
| ) |
|
Definition at line 56 of file TestRailXMLWriter.php.
References $no_new_ids, and $xml.
58 print
"\n found " . $this->no_components .
' components/cases';
59 print
"\n update for " . $this->no_found_ids .
' of ' . $this->no_expexted_ids .
' known IDs';
61 print
"\n known ids unaccounted for: " . implode(
',', $this->expected_by_caseids);
◆ initUISection()
TestRailXMLWriter::initUISection |
( |
| ) |
|
|
protected |
Definition at line 122 of file TestRailXMLWriter.php.
References addCase(), addSection(), getBlockContents(), and getCaseId().
129 $xml_cases = $xml_section->addChild(
'cases');
131 list($build, $case_id) = $this->
getCaseId(self::BASE, self::OPEN);
142 list($build, $case_id) = $this->
getCaseId(self::BASE, self::PREPARE);
getBlockContents(string $block)
getCaseId(string $component_path, string $subkey)
addSection(SimpleXMLElement $xml_parent_node, string $name, string $description='',)
addCase(SimpleXMLElement $xml_parent_node, string $id, string $title, string $preconditions, string $steps, string $expected,)
◆ withData()
TestRailXMLWriter::withData |
( |
array |
$data | ) |
|
- Parameters
-
Definition at line 69 of file TestRailXMLWriter.php.
References $components, and addComponentCases().
73 ->addChild(
'sections');
77 ->addSection($xml_sections, $section,
'')
81 list($component_name, $entry) = $component;
82 $this->no_components += 2;
addComponentCases(SimpleXMLElement $xml_parent_node, string $section, string $component_name, ComponentEntry $entry,)
◆ $expected_by_caseids
array TestRailXMLWriter::$expected_by_caseids = [] |
|
protected |
◆ $no_components
int TestRailXMLWriter::$no_components = 2 |
|
protected |
◆ $no_expexted_ids
int TestRailXMLWriter::$no_expexted_ids = 0 |
|
protected |
◆ $no_found_ids
int TestRailXMLWriter::$no_found_ids = 0 |
|
protected |
◆ $no_new_ids
int TestRailXMLWriter::$no_new_ids = 0 |
|
protected |
◆ $xml
SimpleXMLElement TestRailXMLWriter::$xml |
|
protected |
◆ BASE
const TestRailXMLWriter::BASE = 'UIBASE' |
|
protected |
◆ OPEN
const TestRailXMLWriter::OPEN = 'open' |
|
protected |
◆ PREPARE
const TestRailXMLWriter::PREPARE = 'prepare' |
|
protected |
◆ SHOW
const TestRailXMLWriter::SHOW = 'show' |
|
protected |
◆ VALIDATE
const TestRailXMLWriter::VALIDATE = 'validate' |
|
protected |
The documentation for this class was generated from the following file: