Skip to content

Commit 7fa2ef5

Browse files
committed
chore: add tests for and group and or group dimension filters
1 parent 7b537be commit 7fa2ef5

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ coverage
77
.phpunit.result.cache
88
.env
99
.env.test
10+
run_tests.sh

tests/LaravelGoogleAnalyticsTest.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,30 @@ public function it_should_work_with_limit_and_offset()
9090

9191
$this->assertCount(3, $result->table);
9292
}
93+
94+
/** @test */
95+
public function it_should_filter_dimension_with_and_group()
96+
{
97+
$result = $this->analytics
98+
->whereAndGroupDimensions([
99+
['browser', MatchType::CONTAINS, 'firefox'],
100+
['browser', MatchType::CONTAINS, 'chrome']
101+
])
102+
->get();
103+
104+
$this->assertCount(0, $result->table);
105+
}
106+
107+
/** @test */
108+
public function it_should_filter_dimension_with_or_group()
109+
{
110+
$result = $this->analytics
111+
->whereOrGroupDimensions([
112+
['browser', MatchType::CONTAINS, 'firefox'],
113+
['browser', MatchType::CONTAINS, 'chrome']
114+
])
115+
->get();
116+
117+
$this->assertCount(18, $result->table);
118+
}
93119
}

0 commit comments

Comments
 (0)