Skip to content

Commit c5f1af6

Browse files
committed
Fixed tests
1 parent ffccbc8 commit c5f1af6

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/Subscriber/ApproveCiForNonContributors.php

+5
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ class ApproveCiForNonContributors implements EventSubscriberInterface
1616
{
1717
private WorkflowApi $workflowApi;
1818

19+
public function __construct(WorkflowApi $workflowApi)
20+
{
21+
$this->workflowApi = $workflowApi;
22+
}
23+
1924
public function onPullRequest(GitHubEvent $event)
2025
{
2126
$data = $event->getData();

tests/Controller/WebhookControllerTest.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,12 @@ public function getTests()
6767
'On pull request opened' => [
6868
'pull_request',
6969
'pull_request.opened.json',
70-
['pull_request' => 3, 'status_change' => 'needs_review', 'pr_labels' => ['Console', 'Bug'], 'unsupported_branch' => '2.5'],
70+
['pull_request' => 3, 'status_change' => 'needs_review', 'pr_labels' => ['Console', 'Bug'], 'unsupported_branch' => '2.5', 'approved_run' => true],
7171
],
7272
'On draft pull request opened' => [
7373
'pull_request',
7474
'pull_request.opened_draft.json',
75-
['pull_request' => 3, 'draft_comment' => true],
75+
['pull_request' => 3, 'draft_comment' => true, 'approved_run' => true],
7676
],
7777
'On pull request draft to ready' => [
7878
'pull_request',
@@ -87,7 +87,7 @@ public function getTests()
8787
'On pull request opened with target branch' => [
8888
'pull_request',
8989
'pull_request.opened_target_branch.json',
90-
['pull_request' => 3, 'status_change' => 'needs_review', 'pr_labels' => ['Bug'], 'milestone' => '4.4'],
90+
['pull_request' => 3, 'status_change' => 'needs_review', 'pr_labels' => ['Bug'], 'milestone' => '4.4', 'approved_run' => true],
9191
],
9292
'On issue labeled bug' => [
9393
'issues',
@@ -102,7 +102,7 @@ public function getTests()
102102
'Welcome first users' => [
103103
'pull_request',
104104
'pull_request.new_contributor.json',
105-
['pull_request' => 4, 'status_change' => 'needs_review', 'pr_labels' => [], 'new_contributor' => true, 'squash_comment' => true],
105+
['pull_request' => 4, 'status_change' => 'needs_review', 'pr_labels' => [], 'new_contributor' => true, 'squash_comment' => true, 'approved_run' => true],
106106
],
107107
'Waiting Code Merge' => [
108108
'pull_request',

0 commit comments

Comments
 (0)