Skip to content

Commit cb10ed0

Browse files
author
Alex Westergaard
committed
Change test to fit PHPUnit for PHP 7.0
1 parent 8c7e1ad commit cb10ed0

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

test/AnalyticsTest.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,14 @@ public function testExceptionIfTimeOlderThanOffsetLimit()
5858
{
5959
$this->prepareSituation();
6060

61-
$this->expectException(GA4Exception::class);
62-
63-
$this->analytics->setTimestamp(strtotime('-1 week'));
61+
try {
62+
$this->analytics->setTimestamp(strtotime('-1 week'));
63+
$this->assertTrue(false, "Did not receive correct Exception");
64+
} catch (GA4Exception $e) {
65+
$this->assertTrue(true);
66+
} catch (Exception $e) {
67+
$this->assertTrue(false, "Did not receive correct Exception");
68+
}
6469
}
6570

6671
public function testItem()

0 commit comments

Comments
 (0)