File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
src/Magento/FunctionalTestingFramework/Extension Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,12 @@ class TestContextExtension extends BaseExtension
32
32
*/
33
33
public static $ events ;
34
34
35
+ /**
36
+ * The name of the currently running test
37
+ * @var string
38
+ */
39
+ public $ currentTest ;
40
+
35
41
/**
36
42
* Initialize local vars
37
43
*
@@ -55,8 +61,20 @@ public function _initialize()
55
61
* @throws \Exception
56
62
* @return void
57
63
*/
58
- public function testStart ()
64
+ public function testStart (\ Codeception \ Event \ TestEvent $ e )
59
65
{
66
+ if (getenv ('ENABLE_CODE_COVERAGE ' ) === 'true ' ) {
67
+ // Curl against test.php and pass in the test name. Used when gathering code coverage.
68
+ $ this ->currentTest = $ e ->getTest ()->getMetadata ()->getName ();
69
+ $ cURLConnection = curl_init ();
70
+ curl_setopt_array ($ cURLConnection , [
71
+ CURLOPT_RETURNTRANSFER => 1 ,
72
+ CURLOPT_URL => getenv ('MAGENTO_BASE_URL ' ) . "/test.php?test= " . $ this ->currentTest ,
73
+ ]);
74
+ curl_exec ($ cURLConnection );
75
+ curl_close ($ cURLConnection );
76
+ }
77
+
60
78
PersistedObjectHandler::getInstance ()->clearHookObjects ();
61
79
PersistedObjectHandler::getInstance ()->clearTestObjects ();
62
80
}
You can’t perform that action at this time.
0 commit comments