10
10
use Magento \FunctionalTestingFramework \Test \Handlers \ActionGroupObjectHandler ;
11
11
use Magento \FunctionalTestingFramework \Test \Objects \ActionGroupObject ;
12
12
use Magento \FunctionalTestingFramework \Test \Objects \TestObject ;
13
+ use Magento \FunctionalTestingFramework \Test \Util \ActionGroupAnnotationExtractor ;
14
+ use Magento \FunctionalTestingFramework \Test \Util \ActionGroupObjectExtractor ;
13
15
14
16
/**
15
17
* Class TestGenerator
@@ -26,10 +28,8 @@ class DocGenerator
26
28
DIRECTORY_SEPARATOR .
27
29
"docs " ;
28
30
const DOC_NAME = "documentation.md " ;
29
- const ANNOTATION_PAGE = "page " ;
30
- const ANNOTATION_DESCRIPTION = "description " ;
31
+ # This is the only place FILENAMES is defined as this string
31
32
const FILENAMES = "filenames " ;
32
- const ARGUMENTS = "arguments " ;
33
33
34
34
/**
35
35
* DocGenerator constructor.
@@ -72,14 +72,14 @@ public function createDocumentation($annotatedObjects, $outputDir, $clean)
72
72
$ arguments = $ object ->getArguments ();
73
73
74
74
$ info = [
75
- self :: ANNOTATION_DESCRIPTION => $ annotations [self :: ANNOTATION_DESCRIPTION ]
75
+ actionGroupObject:: ACTION_GROUP_DESCRIPTION => $ annotations [actionGroupObject:: ACTION_GROUP_DESCRIPTION ]
76
76
?? 'NO_DESCRIPTION_SPECIFIED ' ,
77
77
self ::FILENAMES => $ filenames ,
78
- self :: ARGUMENTS => $ arguments
78
+ ActionGroupObjectExtractor:: ACTION_GROUP_ARGUMENTS => $ arguments
79
79
];
80
80
$ pageGroups = array_merge_recursive (
81
81
$ pageGroups ,
82
- [$ annotations [self :: ANNOTATION_PAGE ] ?? 'NO_PAGE_SPECIFIED ' => [$ name => $ info ]]
82
+ [$ annotations [ActionGroupObject:: ACTION_GROUP_PAGE ] ?? 'NO_PAGE_SPECIFIED ' => [$ name => $ info ]]
83
83
);
84
84
}
85
85
@@ -118,12 +118,12 @@ private function transformToMarkdown($annotationList)
118
118
$ markdown .= "## $ group " . PHP_EOL . PHP_EOL ;
119
119
foreach ($ objects as $ name => $ annotations ) {
120
120
$ markdown .= "### $ name " . PHP_EOL ;
121
- $ markdown .= $ annotations [self :: ANNOTATION_DESCRIPTION ] . PHP_EOL . PHP_EOL ;
122
- if (!empty ($ annotations [self :: ARGUMENTS ])) {
121
+ $ markdown .= $ annotations [actionGroupObject:: ACTION_GROUP_DESCRIPTION ] . PHP_EOL . PHP_EOL ;
122
+ if (!empty ($ annotations [ActionGroupObjectExtractor:: ACTION_GROUP_ARGUMENTS ])) {
123
123
$ markdown .= "Action Group Arguments: " . PHP_EOL . PHP_EOL ;
124
124
$ markdown .= "| Name | Type | " . PHP_EOL ;
125
125
$ markdown .= "| --- | --- | " . PHP_EOL ;
126
- foreach ($ annotations [self :: ARGUMENTS ] as $ argument ) {
126
+ foreach ($ annotations [ActionGroupObjectExtractor:: ACTION_GROUP_ARGUMENTS ] as $ argument ) {
127
127
$ argumentName = $ argument ->getName ();
128
128
$ argumentType = $ argument ->getDataType ();
129
129
$ markdown .= "| $ argumentName | $ argumentType | " . PHP_EOL ;
0 commit comments