@@ -50,14 +50,36 @@ class AllureAdapter extends Extension
50
50
Events::TEST_SKIPPED => 'testSkipped ' ,
51
51
Events::TEST_END => 'testEnd ' ,
52
52
Events::STEP_BEFORE => 'stepBefore ' ,
53
- Events::STEP_FAIL => 'stepFail ' ,
54
53
Events::STEP_AFTER => 'stepAfter '
55
54
];
56
55
57
- public function _initialize ()
56
+ /**
57
+ * Annotations that should be ignored by the annotaions parser (especially PHPUnit annotations).
58
+ *
59
+ * @var array
60
+ */
61
+ private $ ignoredAnnotations = [
62
+ 'after ' , 'afterClass ' , 'backupGlobals ' , 'backupStaticAttributes ' , 'before ' , 'beforeClass ' ,
63
+ 'codeCoverageIgnore ' , 'codeCoverageIgnoreStart ' , 'codeCoverageIgnoreEnd ' , 'covers ' ,
64
+ 'coversDefaultClass ' , 'coversNothing ' , 'dataProvider ' , 'depends ' , 'expectedException ' ,
65
+ 'expectedExceptionCode ' , 'expectedExceptionMessage ' , 'group ' , 'large ' , 'medium ' ,
66
+ 'preserveGlobalState ' , 'requires ' , 'runTestsInSeparateProcesses ' , 'runInSeparateProcess ' ,
67
+ 'small ' , 'test ' , 'testdox ' , 'ticket ' , 'uses ' ,
68
+ ];
69
+
70
+ /**
71
+ * Extra annotations to ignore in addition to standard PHPUnit annotations.
72
+ *
73
+ * @param array $ignoredAnnotations
74
+ */
75
+ public function _initialize (array $ ignoredAnnotations = [])
58
76
{
59
77
parent ::_initialize ();
60
78
Annotation \AnnotationProvider::registerAnnotationNamespaces ();
79
+ // Add standard PHPUnit annotations
80
+ Annotation \AnnotationProvider::addIgnoredAnnotations ($ this ->ignoredAnnotations );
81
+ // Add custom ignored annotations
82
+ Annotation \AnnotationProvider::addIgnoredAnnotations ($ ignoredAnnotations );
61
83
$ outputDirectory = $ this ->getOutputDirectory ();
62
84
$ deletePreviousResults =
63
85
$ this ->tryGetOption (DELETE_PREVIOUS_RESULTS_PARAMETER , false );
@@ -156,8 +178,10 @@ public function suiteBefore(SuiteEvent $suiteEvent)
156
178
$ suite = $ suiteEvent ->getSuite ();
157
179
$ suiteName = $ suite ->getName ();
158
180
$ event = new TestSuiteStartedEvent ($ suiteName );
159
- if (class_exists ($ suiteName )){
160
- $ annotationManager = new Annotation \AnnotationManager (Annotation \AnnotationProvider::getClassAnnotations (get_class ($ suite )));
181
+ if (class_exists ($ suiteName , false )) {
182
+ $ annotationManager = new Annotation \AnnotationManager (
183
+ Annotation \AnnotationProvider::getClassAnnotations ($ suiteName )
184
+ );
161
185
$ annotationManager ->updateTestSuiteEvent ($ event );
162
186
}
163
187
$ this ->uuid = $ event ->getUuid ();
@@ -218,10 +242,6 @@ public function stepAfter()
218
242
$ this ->getLifecycle ()->fire (new StepFinishedEvent ());
219
243
}
220
244
221
- public function stepFail ()
222
- {
223
- $ this ->getLifecycle ()->fire (new StepFailedEvent ());
224
- }
225
245
226
246
/**
227
247
* @return Allure
0 commit comments