| @@ 10-19 (lines=10) @@ | ||
| 7 | ||
| 8 | class TrackTest extends BaseTest |
|
| 9 | { |
|
| 10 | public function testEvent() |
|
| 11 | { |
|
| 12 | $track = $this->getTrack(); |
|
| 13 | ||
| 14 | $this->assertCount(0, $this->orm->source(Statistics::class)); |
|
| 15 | ||
| 16 | $track->event('some-event', 1.23); |
|
| 17 | ||
| 18 | $this->assertCount(1, $this->orm->source(Statistics::class)); |
|
| 19 | } |
|
| 20 | ||
| 21 | public function testEventInc() |
|
| 22 | { |
|
| @@ 78-90 (lines=13) @@ | ||
| 75 | $this->assertSame(1.23, $event->value); |
|
| 76 | } |
|
| 77 | ||
| 78 | public function testEvents() |
|
| 79 | { |
|
| 80 | $track = $this->getTrack(); |
|
| 81 | ||
| 82 | $this->assertCount(0, $this->orm->source(Statistics::class)); |
|
| 83 | ||
| 84 | $track->events([ |
|
| 85 | 'some-event' => 1.23, |
|
| 86 | 'some-event2' => 2.34 |
|
| 87 | ]); |
|
| 88 | ||
| 89 | $this->assertCount(2, $this->orm->source(Statistics::class)); |
|
| 90 | } |
|
| 91 | ||
| 92 | public function testEmptyEvents() |
|
| 93 | { |
|
| @@ 92-101 (lines=10) @@ | ||
| 89 | $this->assertCount(2, $this->orm->source(Statistics::class)); |
|
| 90 | } |
|
| 91 | ||
| 92 | public function testEmptyEvents() |
|
| 93 | { |
|
| 94 | $track = $this->getTrack(); |
|
| 95 | ||
| 96 | $this->assertCount(0, $this->orm->source(Statistics::class)); |
|
| 97 | ||
| 98 | $track->events([]); |
|
| 99 | ||
| 100 | $this->assertCount(0, $this->orm->source(Statistics::class)); |
|
| 101 | } |
|
| 102 | ||
| 103 | public function testEventsInc() |
|
| 104 | { |
|