-
-
Notifications
You must be signed in to change notification settings - Fork 18
/
autoload.php
110 lines (99 loc) · 4.14 KB
/
autoload.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<?php
if (class_exists(\PHPUnit\Framework\MockObject\Rule\InvocationOrder::class)) {
class_alias(
\PHPUnit\Framework\MockObject\Rule\InvocationOrder::class,
\PHPUnit\Framework\MockObject\Matcher\Invocation::class
);
} elseif (! interface_exists(\PHPUnit\Framework\MockObject\Matcher\Invocation::class)) {
class_alias(
\PHPUnit_Framework_MockObject_Matcher_Invocation::class,
\PHPUnit\Framework\MockObject\Matcher\Invocation::class
);
}
if (! interface_exists(\PHPUnit\Framework\MockObject\Invocation::class)
&& interface_exists(\PHPUnit_Framework_MockObject_Invocation::class)
) {
class_alias(
\PHPUnit_Framework_MockObject_Invocation::class,
\PHPUnit\Framework\MockObject\Invocation::class
);
}
if (! interface_exists(\PHPUnit\Framework\MockObject\MockObject::class)) {
class_alias(
\PHPUnit_Framework_MockObject_MockObject::class,
\PHPUnit\Framework\MockObject\MockObject::class
);
}
if (! class_exists(\PHPUnit\Framework\MockObject\Builder\InvocationMocker::class)) {
class_alias(
\PHPUnit_Framework_MockObject_Builder_InvocationMocker::class,
\PHPUnit\Framework\MockObject\Builder\InvocationMocker::class
);
}
if (class_exists(\PHPUnit\Framework\MockObject\Rule\MethodName::class)) {
class_alias(
\PHPUnit\Framework\MockObject\Rule\MethodName::class,
\PHPUnit\Framework\MockObject\Matcher\MethodName::class
);
}
if (! class_exists(\PHPUnit\Framework\MockObject\Matcher\MethodName::class)) {
class_alias(
\PHPUnit_Framework_MockObject_Matcher_MethodName::class,
\PHPUnit\Framework\MockObject\Matcher\MethodName::class
);
}
if (!class_exists(\PHPUnit\Framework\MockObject\InvocationHandler::class)
&& !interface_exists(\PHPUnit\Framework\MockObject\Stub\MatcherCollection::class)
) {
class_alias(
\PHPUnit_Framework_MockObject_Stub_MatcherCollection::class,
\PHPUnit\Framework\MockObject\Stub\MatcherCollection::class
);
}
if (!class_exists(\PHPUnit\Framework\MockObject\InvocationHandler::class)
&& !class_exists(\PHPUnit\Framework\MockObject\InvocationMocker::class)
) {
class_alias(
\PHPUnit_Framework_MockObject_InvocationMocker::class,
\PHPUnit\Framework\MockObject\InvocationMocker::class
);
}
$hasVersion = class_exists(\PHPUnit\Runner\Version::class);
if ($hasVersion
&& version_compare(\PHPUnit\Runner\Version::id(), '10.0.0') >= 0
) {
class_alias(
phpmock\phpunit\MockDisablerPHPUnit10::class,
phpmock\phpunit\MockDisabler::class
);
} elseif (! class_exists(\PHPUnit\Framework\BaseTestListener::class)) {
include __DIR__ . '/compatibility/BaseTestListener.php';
class_alias(
phpmock\phpunit\MockDisablerPHPUnit7::class,
phpmock\phpunit\MockDisabler::class
);
} else {
class_alias(
phpmock\phpunit\MockDisablerPHPUnit6::class,
phpmock\phpunit\MockDisabler::class
);
}
if ($hasVersion
&& version_compare(\PHPUnit\Runner\Version::id(), '10.0.0') >= 0
) {
class_alias(\phpmock\phpunit\DefaultArgumentRemoverReturnTypes100::class, \phpmock\phpunit\DefaultArgumentRemover::class);
class_alias(\phpmock\phpunit\MockObjectProxyReturnTypes100::class, \phpmock\phpunit\MockObjectProxy::class);
} elseif ($hasVersion
&& version_compare(\PHPUnit\Runner\Version::id(), '8.4.0') >= 0
) {
class_alias(\phpmock\phpunit\DefaultArgumentRemoverReturnTypes84::class, \phpmock\phpunit\DefaultArgumentRemover::class);
class_alias(\phpmock\phpunit\MockObjectProxyReturnTypes84::class, \phpmock\phpunit\MockObjectProxy::class);
} elseif ($hasVersion
&& version_compare(\PHPUnit\Runner\Version::id(), '8.1.0') >= 0
) {
class_alias(\phpmock\phpunit\DefaultArgumentRemoverReturnTypes::class, \phpmock\phpunit\DefaultArgumentRemover::class);
class_alias(\phpmock\phpunit\MockObjectProxyReturnTypes::class, \phpmock\phpunit\MockObjectProxy::class);
} else {
class_alias(\phpmock\phpunit\DefaultArgumentRemoverNoReturnTypes::class, \phpmock\phpunit\DefaultArgumentRemover::class);
class_alias(\phpmock\phpunit\MockObjectProxyNoReturnTypes::class, \phpmock\phpunit\MockObjectProxy::class);
}