Code Duplication    Length = 12-12 lines in 2 locations

module/Core/test/Service/ShortUrl/DeleteShortUrlServiceTest.php 2 locations

@@ 61-72 (lines=12) @@
58
    /**
59
     * @test
60
     */
61
    public function deleteByShortCodeDeletesUrlWhenThresholdIsReachedButCheckIsDisabled()
62
    {
63
        $service = $this->createService(false);
64
65
        $remove = $this->em->remove(Argument::type(ShortUrl::class))->willReturn(null);
66
        $flush = $this->em->flush()->willReturn(null);
67
68
        $service->deleteByShortCode('abc123');
69
70
        $remove->shouldHaveBeenCalledTimes(1);
71
        $flush->shouldHaveBeenCalledTimes(1);
72
    }
73
74
    /**
75
     * @test
@@ 77-88 (lines=12) @@
74
    /**
75
     * @test
76
     */
77
    public function deleteByShortCodeDeletesUrlWhenThresholdIsNotReached()
78
    {
79
        $service = $this->createService(true, 100);
80
81
        $remove = $this->em->remove(Argument::type(ShortUrl::class))->willReturn(null);
82
        $flush = $this->em->flush()->willReturn(null);
83
84
        $service->deleteByShortCode('abc123');
85
86
        $remove->shouldHaveBeenCalledTimes(1);
87
        $flush->shouldHaveBeenCalledTimes(1);
88
    }
89
90
    private function createService(bool $checkVisitsThreshold = true, int $visitsThreshold = 5): DeleteShortUrlService
91
    {