@@ -21,30 +21,6 @@ class AddUniqueAttachmentEvent extends AddAttachmentEvent
21
21
*/
22
22
private static $ instance ;
23
23
24
- /**
25
- * An alternative way to instantiate an instance of this class. Used to mock this class object in unit tests.
26
- *
27
- * @param mixed $filePathOrContents
28
- * @param string $caption
29
- * @param string|null $type
30
- *
31
- * @return AddUniqueAttachmentEvent
32
- */
33
- public static function getInstance (
34
- $ filePathOrContents ,
35
- string $ caption ,
36
- ?string $ type = null
37
- ): AddUniqueAttachmentEvent {
38
- if (!self ::$ instance ) {
39
- self ::$ instance = new AddUniqueAttachmentEvent (
40
- $ filePathOrContents ,
41
- $ caption ,
42
- $ type
43
- );
44
- }
45
- return self ::$ instance ;
46
- }
47
-
48
24
/**
49
25
* Near copy of parent function, added uniqid call for filename to prevent buggy allure behavior.
50
26
*
@@ -93,6 +69,30 @@ public function copyFile(string $filePath, string $outputPath): bool
93
69
return copy ($ filePath , $ outputPath );
94
70
}
95
71
72
+ /**
73
+ * Unit test helper function.
74
+ *
75
+ * @param mixed $filePathOrContents
76
+ * @param string $caption
77
+ * @param string|null $type
78
+ *
79
+ * @return AddUniqueAttachmentEvent
80
+ */
81
+ public static function getInstance (
82
+ $ filePathOrContents ,
83
+ string $ caption ,
84
+ ?string $ type = null
85
+ ): AddUniqueAttachmentEvent {
86
+ if (!self ::$ instance ) {
87
+ self ::$ instance = new AddUniqueAttachmentEvent (
88
+ $ filePathOrContents ,
89
+ $ caption ,
90
+ $ type
91
+ );
92
+ }
93
+ return self ::$ instance ;
94
+ }
95
+
96
96
/**
97
97
* Copy of parent private function.
98
98
*
0 commit comments