6
6
7
7
namespace tests \verification \Tests ;
8
8
9
- use Magento \FunctionalTestingFramework \Test \Handlers \TestObjectHandler ;
10
- use Magento \FunctionalTestingFramework \Util \TestGenerator ;
11
- use PHPUnit \Framework \TestCase ;
9
+ use tests \util \MftfTestCase ;
12
10
13
- class ActionGroupMergeGenerationTest extends TestCase
11
+ class ActionGroupMergeGenerationTest extends MftfTestCase
14
12
{
15
- const RESOURCES_PATH = __DIR__ . '/../Resources ' ;
16
-
17
13
/**
18
14
* Tests flat generation of a hardcoded test file with no external references.
19
15
*
@@ -22,7 +18,7 @@ class ActionGroupMergeGenerationTest extends TestCase
22
18
*/
23
19
public function testBasicActionGroup ()
24
20
{
25
- $ this ->runComparisonTest ('BasicActionGroupTest ' );
21
+ $ this ->generateAndCompareTest ('BasicActionGroupTest ' );
26
22
}
27
23
28
24
/**
@@ -33,7 +29,7 @@ public function testBasicActionGroup()
33
29
*/
34
30
public function testActionGroupWithData ()
35
31
{
36
- $ this ->runComparisonTest ('ActionGroupWithDataTest ' );
32
+ $ this ->generateAndCompareTest ('ActionGroupWithDataTest ' );
37
33
}
38
34
39
35
/**
@@ -44,7 +40,7 @@ public function testActionGroupWithData()
44
40
*/
45
41
public function testActionGroupWithDataOverride ()
46
42
{
47
- $ this ->runComparisonTest ('ActionGroupWithDataOverrideTest ' );
43
+ $ this ->generateAndCompareTest ('ActionGroupWithDataOverrideTest ' );
48
44
}
49
45
50
46
/**
@@ -55,7 +51,7 @@ public function testActionGroupWithDataOverride()
55
51
*/
56
52
public function testActionGroupWithNoDefault ()
57
53
{
58
- $ this ->runComparisonTest ('ActionGroupWithNoDefaultTest ' );
54
+ $ this ->generateAndCompareTest ('ActionGroupWithNoDefaultTest ' );
59
55
}
60
56
61
57
/**
@@ -66,7 +62,7 @@ public function testActionGroupWithNoDefault()
66
62
*/
67
63
public function testActionGroupWithPersistedData ()
68
64
{
69
- $ this ->runComparisonTest ('ActionGroupWithPersistedData ' );
65
+ $ this ->generateAndCompareTest ('ActionGroupWithPersistedData ' );
70
66
}
71
67
72
68
/**
@@ -77,7 +73,7 @@ public function testActionGroupWithPersistedData()
77
73
*/
78
74
public function testActionGroupWithTopLevelPersistedData ()
79
75
{
80
- $ this ->runComparisonTest ('ActionGroupWithTopLevelPersistedData ' );
76
+ $ this ->generateAndCompareTest ('ActionGroupWithTopLevelPersistedData ' );
81
77
}
82
78
83
79
/**
@@ -88,7 +84,7 @@ public function testActionGroupWithTopLevelPersistedData()
88
84
*/
89
85
public function testMultipleActionGroups ()
90
86
{
91
- $ this ->runComparisonTest ('MultipleActionGroupsTest ' );
87
+ $ this ->generateAndCompareTest ('MultipleActionGroupsTest ' );
92
88
}
93
89
94
90
/**
@@ -99,7 +95,7 @@ public function testMultipleActionGroups()
99
95
*/
100
96
public function testMergedActionGroup ()
101
97
{
102
- $ this ->runComparisonTest ('MergedActionGroupTest ' );
98
+ $ this ->generateAndCompareTest ('MergedActionGroupTest ' );
103
99
}
104
100
105
101
/**
@@ -110,25 +106,6 @@ public function testMergedActionGroup()
110
106
*/
111
107
public function testArgumentWithSameNameAsElement ()
112
108
{
113
- $ this ->runComparisonTest ('ArgumentWithSameNameAsElement ' );
114
- }
115
-
116
- /**
117
- * Generate a Test by name and assert that it equals the corresponding .txt source of truth
118
- *
119
- * @param string $testName
120
- * @throws \Exception
121
- * @throws \Magento\FunctionalTestingFramework\Exceptions\TestReferenceException
122
- */
123
- private function runComparisonTest ($ testName )
124
- {
125
- $ test = TestObjectHandler::getInstance ()->getObject ($ testName );
126
- $ testHandler = TestGenerator::getInstance (null , [$ test ]);
127
- $ testHandler ->createAllTestFiles ();
128
-
129
- $ this ->assertFileEquals (
130
- self ::RESOURCES_PATH . DIRECTORY_SEPARATOR . $ test ->getName () . ".txt " ,
131
- $ testHandler ->getExportDir () . DIRECTORY_SEPARATOR . $ test ->getCodeceptionName () . ".php "
132
- );
109
+ $ this ->generateAndCompareTest ('ArgumentWithSameNameAsElement ' );
133
110
}
134
111
}
0 commit comments