Code Duplication    Length = 14-18 lines in 2 locations

tests/Statistics/DatetimeTest.php 2 locations

@@ 14-27 (lines=14) @@
11
    /**
12
     * Default datetime is NOW for track event
13
     */
14
    public function testEventDatetime()
15
    {
16
        $track = $this->getTrack();
17
18
        $this->assertCount(0, $this->orm->source(Occurrence::class));
19
        $this->assertCount(0, $this->orm->source(Event::class));
20
21
        $datetime = new \DateTime('now');
22
        $track->event('some-event', 1.23);
23
        $track->event('some-event2', 2.34, $datetime);
24
25
        $this->assertCount(1, $this->orm->source(Occurrence::class));
26
        $this->assertCount(2, $this->orm->source(Event::class));
27
    }
28
29
    /**
30
     * Default datetime is NOW for track events
@@ 32-49 (lines=18) @@
29
    /**
30
     * Default datetime is NOW for track events
31
     */
32
    public function testEventsDatetime()
33
    {
34
        $track = $this->getTrack();
35
36
        $this->assertCount(0, $this->orm->source(Occurrence::class));
37
        $this->assertCount(0, $this->orm->source(Event::class));
38
39
        $datetime = new \DateTime('now');
40
        $track->events([
41
            'some-event' => 1.23
42
        ]);
43
        $track->events([
44
            'some-event2' => 2.34
45
        ], $datetime);
46
47
        $this->assertCount(1, $this->orm->source(Occurrence::class));
48
        $this->assertCount(2, $this->orm->source(Event::class));
49
    }
50
}