@@ -20,12 +20,7 @@ class StatusChangeByReviewSubscriberTest extends \PHPUnit_Framework_TestCase
20
20
/**
21
21
* @var EventDispatcher
22
22
*/
23
- private static $ dispatcher ;
24
-
25
- public static function setUpBeforeClass ()
26
- {
27
- self ::$ dispatcher = new EventDispatcher ();
28
- }
23
+ private $ dispatcher ;
29
24
30
25
protected function setUp ()
31
26
{
@@ -34,7 +29,8 @@ protected function setUp()
34
29
$ this ->statusChangeSubscriber = new StatusChangeByReviewSubscriber ($ this ->statusApi , $ logger );
35
30
$ this ->repository = new Repository ('weaverryan ' , 'symfony ' , [], null );
36
31
37
- self ::$ dispatcher ->addSubscriber ($ this ->statusChangeSubscriber );
32
+ $ this ->dispatcher = new EventDispatcher ();
33
+ $ this ->dispatcher ->addSubscriber ($ this ->statusChangeSubscriber );
38
34
}
39
35
40
36
/**
@@ -54,7 +50,7 @@ public function testOnReview($comment, $expectedStatus)
54
50
'review ' => array ('state ' => 'commented ' , 'body ' => $ comment , 'user ' => ['login ' => 'leannapelham ' ]),
55
51
), $ this ->repository );
56
52
57
- self :: $ dispatcher ->dispatch (GitHubEvents::PULL_REQUEST_REVIEW , $ event );
53
+ $ this -> dispatcher ->dispatch (GitHubEvents::PULL_REQUEST_REVIEW , $ event );
58
54
59
55
$ responseData = $ event ->getResponseData ();
60
56
@@ -100,9 +96,6 @@ public function getCommentsForStatusChange()
100
96
);
101
97
}
102
98
103
- /**
104
- * @dataProvider getCommentsForStatusChange
105
- */
106
99
public function testOnIssueCommentAuthorSelfReview ()
107
100
{
108
101
$ this ->statusApi ->expects ($ this ->never ())
@@ -124,7 +117,7 @@ public function testOnIssueCommentAuthorSelfReview()
124
117
),
125
118
), $ this ->repository );
126
119
127
- self :: $ dispatcher ->dispatch (GitHubEvents::PULL_REQUEST_REVIEW , $ event );
120
+ $ this -> dispatcher ->dispatch (GitHubEvents::PULL_REQUEST_REVIEW , $ event );
128
121
129
122
$ responseData = $ event ->getResponseData ();
130
123
@@ -144,6 +137,6 @@ public function testOnReviewRequested()
144
137
'pull_request ' => array ('number ' => 1234 )
145
138
), $ this ->repository );
146
139
147
- self :: $ dispatcher ->dispatch (GitHubEvents::PULL_REQUEST , $ event );
140
+ $ this -> dispatcher ->dispatch (GitHubEvents::PULL_REQUEST , $ event );
148
141
}
149
142
}
0 commit comments