7
7
8
8
namespace Magento \SemanticVersionChecker \Test \Unit \Console \Command ;
9
9
10
- use Magento \SemanticVersionChecker \Test \Unit \Console \Command \CompareSourceCommandTest \AbstractTestCase ;
10
+ use Magento \SemanticVersionChecker \Test \Unit \Console \Command \CompareSourceCommandTest \AbstractTestCaseWithRegExp ;
11
11
12
12
/**
13
13
* Test semantic version checker CLI command dealing with di.xml
14
14
*/
15
- class CompareSourceCommandDiXmlTest extends AbstractTestCase
15
+ class CompareSourceCommandDiXmlTest extends AbstractTestCaseWithRegExp
16
16
{
17
17
/**
18
18
* Test semantic version checker CLI command for changes of the database schema.
@@ -21,7 +21,7 @@ class CompareSourceCommandDiXmlTest extends AbstractTestCase
21
21
* @param string $pathToSourceCodeAfter
22
22
* @param string[] $expectedLogEntries
23
23
* @param string $expectedOutput
24
- * @param string[] $unexpectedLogEntries
24
+ * @param bool $shouldSkipTest
25
25
* @return void
26
26
* @throws \Exception
27
27
* @dataProvider changesDataProvider
@@ -31,14 +31,14 @@ public function testExecute(
31
31
$ pathToSourceCodeAfter ,
32
32
$ expectedLogEntries ,
33
33
$ expectedOutput ,
34
- $ unexpectedLogEntries = []
34
+ $ shouldSkipTest = false
35
35
) {
36
36
$ this ->doTestExecute (
37
37
$ pathToSourceCodeBefore ,
38
38
$ pathToSourceCodeAfter ,
39
39
$ expectedLogEntries ,
40
40
$ expectedOutput ,
41
- $ unexpectedLogEntries
41
+ $ shouldSkipTest
42
42
);
43
43
}
44
44
@@ -51,47 +51,55 @@ public function changesDataProvider()
51
51
$ pathToFixtures . '/no-change/source-code-before ' ,
52
52
$ pathToFixtures . '/no-change/source-code-after ' ,
53
53
[
54
-
54
+ ' #Suggested semantic versioning change: NONE# ' ,
55
55
],
56
56
''
57
57
],
58
58
'moved-to-global ' => [
59
59
$ pathToFixtures . '/moved-to-global/source-code-before ' ,
60
60
$ pathToFixtures . '/moved-to-global/source-code-after ' ,
61
61
[
62
- 'Suggested semantic versioning change: NONE ' ,
62
+ '# Suggested semantic versioning change: NONE# ' ,
63
63
],
64
64
'Patch change is detected. ' ,
65
65
],
66
66
'moved-to-specific ' => [
67
67
$ pathToFixtures . '/moved-to-specific/source-code-before ' ,
68
68
$ pathToFixtures . '/moved-to-specific/source-code-after ' ,
69
69
[
70
- 'Suggested semantic versioning change: MAJOR ' ,
70
+ '#Suggested semantic versioning change: MAJOR# ' ,
71
+ '#MAJOR\s*\|\s*Console/Command/CompareSourceCommandTest/_files/di_xml/moved-to-specific/source-code-before/Magento/TestModule/etc/di\.xml:0# ' ,
72
+ '#scope\s*\|\s*Virtual Type was changed\s*\|\s*M201# '
71
73
],
72
74
'Major change is detected. ' ,
73
75
],
74
76
'remove-type ' => [
75
77
$ pathToFixtures . '/remove-type/source-code-before ' ,
76
78
$ pathToFixtures . '/remove-type/source-code-after ' ,
77
79
[
78
- 'Suggested semantic versioning change: MAJOR ' ,
80
+ '#Suggested semantic versioning change: MAJOR# ' ,
81
+ '#MAJOR\s*\|\s*Console/Command/CompareSourceCommandTest/_files/di_xml/remove-type/source-code-before/Magento/TestModule/etc/di\.xml:0# ' ,
82
+ '#customCacheInstance2\s*\|\s*Virtual Type was removed\s*\|\s*M200\s*# '
79
83
],
80
84
'Major change is detected. ' ,
81
85
],
82
86
'change-type ' => [
83
87
$ pathToFixtures . '/change-type/source-code-before ' ,
84
88
$ pathToFixtures . '/change-type/source-code-after ' ,
85
89
[
86
- 'Suggested semantic versioning change: MAJOR ' ,
90
+ '#Suggested semantic versioning change: MAJOR# ' ,
91
+ '#MAJOR\s*\|\s*Console/Command/CompareSourceCommandTest/_files/di_xml/change-type/source-code-before/Magento/TestModule/etc/di\.xml:0# ' ,
92
+ '#type\s*\|\s*Virtual Type was changed\s*\|\s*M201# '
87
93
],
88
94
'Major change is detected. ' ,
89
95
],
90
96
'change-name ' => [
91
- $ pathToFixtures . '/change-type /source-code-before ' ,
92
- $ pathToFixtures . '/change-type /source-code-after ' ,
97
+ $ pathToFixtures . '/change-name /source-code-before ' ,
98
+ $ pathToFixtures . '/change-name /source-code-after ' ,
93
99
[
94
- 'Suggested semantic versioning change: MAJOR ' ,
100
+ '#Suggested semantic versioning change: MAJOR# ' ,
101
+ '#MAJOR\s*\|\s*Console/Command/CompareSourceCommandTest/_files/di_xml/change-name/source-code-before/Magento/TestModule/etc/di\.xml:0# ' ,
102
+ '#cacheInstance\s*\|\s*Virtual Type was removed\s*\|\s*M200# '
95
103
],
96
104
'Major change is detected. ' ,
97
105
],
0 commit comments