Skip to content

Commit 45fd324

Browse files
committed
Test fix
1 parent a14d2ab commit 45fd324

File tree

4 files changed

+25
-5
lines changed

4 files changed

+25
-5
lines changed

config/services.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ services:
7373

7474
App\Api\Issue\IssueApi: '@App\Api\Issue\GithubIssueApi'
7575
App\Api\Label\LabelApi: '@App\Api\Label\GithubLabelApi'
76-
App\Api\Milestone\MilestonesApi: '@App\Api\Issue\GithubIssueApi'
76+
App\Api\Milestone\MilestonesApi: '@App\Api\Milestone\GithubMilestonesApi'
7777
App\Api\Status\StatusApi: '@App\Api\Status\GitHubStatusApi'
7878

7979
App\Service\RepositoryProvider:

config/services_test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ services:
55

66
App\Api\Issue\IssueApi: '@App\Api\Issue\NullIssueApi'
77
App\Api\Label\LabelApi: '@App\Api\Label\StaticLabelApi'
8-
App\Api\Milestone\MilestonesApi: '@App\Api\Issue\NullIssueApi'
8+
App\Api\Milestone\MilestonesApi: '@App\Api\Milestone\StaticMilestoneApi'
99
App\Api\Status\StatusApi: '@App\Api\Status\NullStatusApi'
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace App\Api\Milestone;
6+
7+
use App\Model\Repository;
8+
9+
/**
10+
* Dont fetch data from external source.
11+
*
12+
* @author Tobias Nyholm <[email protected]>
13+
*/
14+
class StaticMilestoneApi extends NullMilestoneApi
15+
{
16+
public function exists(Repository $repository, string $milestoneName): bool
17+
{
18+
return in_array($milestoneName, ['3.4', '4.4', '5.1', '5.x']);
19+
}
20+
}

tests/Controller/WebhookControllerTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
namespace App\Tests\Controller;
44

5-
use App\Issues\StatusApi;
6-
use App\Repository\Provider\RepositoryProviderInterface;
5+
use App\Api\Status\StatusApi;
6+
use App\Service\RepositoryProvider;
77
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
88

99
class WebhookControllerTest extends WebTestCase
@@ -17,7 +17,7 @@ public function setup()
1717
}
1818

1919
$this->client = $this->createClient();
20-
$repository = self::$container->get(RepositoryProviderInterface::class);
20+
$repository = self::$container->get(RepositoryProvider::class);
2121
$statusApi = self::$container->get(StatusApi::class);
2222

2323
// the labels need to be off this issue for one test to pass

0 commit comments

Comments
 (0)