@@ -31,11 +31,7 @@ class ApiDataFixture extends DataFixture
31
31
public function startTest (TestCase $ test )
32
32
{
33
33
Bootstrap::getInstance ()->reinitialize ();
34
- /** Apply method level fixtures if thy are available, apply class level fixtures otherwise */
35
- $ this ->_applyFixtures (
36
- $ this ->_getFixtures ($ test , 'method ' ) ?: $ this ->_getFixtures ($ test , 'class ' ),
37
- $ test
38
- );
34
+ $ this ->_applyFixtures ($ this ->_getFixtures ($ test ), $ test );
39
35
}
40
36
41
37
/**
@@ -46,8 +42,6 @@ public function startTest(TestCase $test)
46
42
public function endTest (TestCase $ test )
47
43
{
48
44
$ this ->_revertFixtures ($ test );
49
- $ objectManager = Bootstrap::getObjectManager ();
50
- $ objectManager ->get (AttributeMetadataCache::class)->clean ();
51
45
}
52
46
53
47
/**
@@ -65,4 +59,23 @@ protected function getDbIsolationState(TestCase $test)
65
59
{
66
60
return parent ::getDbIsolationState ($ test ) ?: ['disabled ' ];
67
61
}
62
+
63
+ /**
64
+ * @inheritdoc
65
+ */
66
+ protected function _applyFixtures (array $ fixtures , TestCase $ test )
67
+ {
68
+ Bootstrap::getInstance ()->reinitialize ();
69
+ parent ::_applyFixtures ($ fixtures , $ test );
70
+ }
71
+
72
+ /**
73
+ * @inheritdoc
74
+ */
75
+ protected function _revertFixtures (?TestCase $ test = null )
76
+ {
77
+ parent ::_revertFixtures ($ test );
78
+ $ objectManager = Bootstrap::getObjectManager ();
79
+ $ objectManager ->get (AttributeMetadataCache::class)->clean ();
80
+ }
68
81
}
0 commit comments