@@ -31,9 +31,7 @@ protected function setUp()
31
31
32
32
public function testSetLazyOption ()
33
33
{
34
- $ test = $ this ;
35
-
36
- $ this ->options ->set ('foo ' , function (Options $ options ) use ($ test ) {
34
+ $ this ->options ->set ('foo ' , function (Options $ options ) {
37
35
return 'dynamic ' ;
38
36
});
39
37
@@ -42,15 +40,12 @@ public function testSetLazyOption()
42
40
43
41
public function testOverloadKeepsPreviousValue ()
44
42
{
45
- $ test = $ this ;
46
-
47
43
// defined by superclass
48
44
$ this ->options ->set ('foo ' , 'bar ' );
49
45
50
46
// defined by subclass
51
- $ this ->options ->overload ('foo ' , function (Options $ options , $ previousValue ) use ($ test ) {
52
- /* @var \PHPUnit_Framework_TestCase $test */
53
- $ test ->assertEquals ('bar ' , $ previousValue );
47
+ $ this ->options ->overload ('foo ' , function (Options $ options , $ previousValue ) {
48
+ $ this ->assertEquals ('bar ' , $ previousValue );
54
49
55
50
return 'dynamic ' ;
56
51
});
@@ -60,17 +55,14 @@ public function testOverloadKeepsPreviousValue()
60
55
61
56
public function testPreviousValueIsEvaluatedIfLazy ()
62
57
{
63
- $ test = $ this ;
64
-
65
58
// defined by superclass
66
59
$ this ->options ->set ('foo ' , function (Options $ options ) {
67
60
return 'bar ' ;
68
61
});
69
62
70
63
// defined by subclass
71
- $ this ->options ->overload ('foo ' , function (Options $ options , $ previousValue ) use ($ test ) {
72
- /* @var \PHPUnit_Framework_TestCase $test */
73
- $ test ->assertEquals ('bar ' , $ previousValue );
64
+ $ this ->options ->overload ('foo ' , function (Options $ options , $ previousValue ) {
65
+ $ this ->assertEquals ('bar ' , $ previousValue );
74
66
75
67
return 'dynamic ' ;
76
68
});
@@ -80,15 +72,13 @@ public function testPreviousValueIsEvaluatedIfLazy()
80
72
81
73
public function testPreviousValueIsNotEvaluatedIfNoSecondArgument ()
82
74
{
83
- $ test = $ this ;
84
-
85
75
// defined by superclass
86
- $ this ->options ->set ('foo ' , function (Options $ options ) use ( $ test ) {
87
- $ test ->fail ('Should not be called ' );
76
+ $ this ->options ->set ('foo ' , function (Options $ options ) {
77
+ $ this ->fail ('Should not be called ' );
88
78
});
89
79
90
80
// defined by subclass, no $previousValue argument defined!
91
- $ this ->options ->overload ('foo ' , function (Options $ options ) use ( $ test ) {
81
+ $ this ->options ->overload ('foo ' , function (Options $ options ) {
92
82
return 'dynamic ' ;
93
83
});
94
84
@@ -97,13 +87,10 @@ public function testPreviousValueIsNotEvaluatedIfNoSecondArgument()
97
87
98
88
public function testLazyOptionCanAccessOtherOptions ()
99
89
{
100
- $ test = $ this ;
101
-
102
90
$ this ->options ->set ('foo ' , 'bar ' );
103
91
104
- $ this ->options ->set ('bam ' , function (Options $ options ) use ($ test ) {
105
- /* @var \PHPUnit_Framework_TestCase $test */
106
- $ test ->assertEquals ('bar ' , $ options ->get ('foo ' ));
92
+ $ this ->options ->set ('bam ' , function (Options $ options ) {
93
+ $ this ->assertEquals ('bar ' , $ options ->get ('foo ' ));
107
94
108
95
return 'dynamic ' ;
109
96
});
@@ -113,15 +100,12 @@ public function testLazyOptionCanAccessOtherOptions()
113
100
114
101
public function testLazyOptionCanAccessOtherLazyOptions ()
115
102
{
116
- $ test = $ this ;
117
-
118
103
$ this ->options ->set ('foo ' , function (Options $ options ) {
119
104
return 'bar ' ;
120
105
});
121
106
122
- $ this ->options ->set ('bam ' , function (Options $ options ) use ($ test ) {
123
- /* @var \PHPUnit_Framework_TestCase $test */
124
- $ test ->assertEquals ('bar ' , $ options ->get ('foo ' ));
107
+ $ this ->options ->set ('bam ' , function (Options $ options ) {
108
+ $ this ->assertEquals ('bar ' , $ options ->get ('foo ' ));
125
109
126
110
return 'dynamic ' ;
127
111
});
@@ -153,14 +137,11 @@ public function testNormalizerReceivesUnnormalizedValue()
153
137
154
138
public function testNormalizerCanAccessOtherOptions ()
155
139
{
156
- $ test = $ this ;
157
-
158
140
$ this ->options ->set ('foo ' , 'bar ' );
159
141
$ this ->options ->set ('bam ' , 'baz ' );
160
142
161
- $ this ->options ->setNormalizer ('bam ' , function (Options $ options ) use ($ test ) {
162
- /* @var \PHPUnit_Framework_TestCase $test */
163
- $ test ->assertEquals ('bar ' , $ options ->get ('foo ' ));
143
+ $ this ->options ->setNormalizer ('bam ' , function (Options $ options ) {
144
+ $ this ->assertEquals ('bar ' , $ options ->get ('foo ' ));
164
145
165
146
return 'normalized ' ;
166
147
});
@@ -170,16 +151,13 @@ public function testNormalizerCanAccessOtherOptions()
170
151
171
152
public function testNormalizerCanAccessOtherLazyOptions ()
172
153
{
173
- $ test = $ this ;
174
-
175
154
$ this ->options ->set ('foo ' , function (Options $ options ) {
176
155
return 'bar ' ;
177
156
});
178
157
$ this ->options ->set ('bam ' , 'baz ' );
179
158
180
- $ this ->options ->setNormalizer ('bam ' , function (Options $ options ) use ($ test ) {
181
- /* @var \PHPUnit_Framework_TestCase $test */
182
- $ test ->assertEquals ('bar ' , $ options ->get ('foo ' ));
159
+ $ this ->options ->setNormalizer ('bam ' , function (Options $ options ) {
160
+ $ this ->assertEquals ('bar ' , $ options ->get ('foo ' ));
183
161
184
162
return 'normalized ' ;
185
163
});
0 commit comments