@@ -20,12 +20,7 @@ class StatusChangeByReviewSubscriberTest extends \PHPUnit_Framework_TestCase
2020 /**
2121 * @var EventDispatcher
2222 */
23- private static $ dispatcher ;
24-
25- public static function setUpBeforeClass ()
26- {
27- self ::$ dispatcher = new EventDispatcher ();
28- }
23+ private $ dispatcher ;
2924
3025 protected function setUp ()
3126 {
@@ -34,7 +29,8 @@ protected function setUp()
3429 $ this ->statusChangeSubscriber = new StatusChangeByReviewSubscriber ($ this ->statusApi , $ logger );
3530 $ this ->repository = new Repository ('weaverryan ' , 'symfony ' , [], null );
3631
37- self ::$ dispatcher ->addSubscriber ($ this ->statusChangeSubscriber );
32+ $ this ->dispatcher = new EventDispatcher ();
33+ $ this ->dispatcher ->addSubscriber ($ this ->statusChangeSubscriber );
3834 }
3935
4036 /**
@@ -54,7 +50,7 @@ public function testOnReview($comment, $expectedStatus)
5450 'review ' => array ('state ' => 'commented ' , 'body ' => $ comment , 'user ' => ['login ' => 'leannapelham ' ]),
5551 ), $ this ->repository );
5652
57- self :: $ dispatcher ->dispatch (GitHubEvents::PULL_REQUEST_REVIEW , $ event );
53+ $ this -> dispatcher ->dispatch (GitHubEvents::PULL_REQUEST_REVIEW , $ event );
5854
5955 $ responseData = $ event ->getResponseData ();
6056
@@ -100,9 +96,6 @@ public function getCommentsForStatusChange()
10096 );
10197 }
10298
103- /**
104- * @dataProvider getCommentsForStatusChange
105- */
10699 public function testOnIssueCommentAuthorSelfReview ()
107100 {
108101 $ this ->statusApi ->expects ($ this ->never ())
@@ -124,7 +117,7 @@ public function testOnIssueCommentAuthorSelfReview()
124117 ),
125118 ), $ this ->repository );
126119
127- self :: $ dispatcher ->dispatch (GitHubEvents::PULL_REQUEST_REVIEW , $ event );
120+ $ this -> dispatcher ->dispatch (GitHubEvents::PULL_REQUEST_REVIEW , $ event );
128121
129122 $ responseData = $ event ->getResponseData ();
130123
@@ -144,6 +137,6 @@ public function testOnReviewRequested()
144137 'pull_request ' => array ('number ' => 1234 )
145138 ), $ this ->repository );
146139
147- self :: $ dispatcher ->dispatch (GitHubEvents::PULL_REQUEST , $ event );
140+ $ this -> dispatcher ->dispatch (GitHubEvents::PULL_REQUEST , $ event );
148141 }
149142}
0 commit comments