diff options
Diffstat (limited to 'plugins/Goals/tests')
-rw-r--r-- | plugins/Goals/tests/Integration/APITest.php | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/plugins/Goals/tests/Integration/APITest.php b/plugins/Goals/tests/Integration/APITest.php index 12ce5cb09f..478dadaad6 100644 --- a/plugins/Goals/tests/Integration/APITest.php +++ b/plugins/Goals/tests/Integration/APITest.php @@ -43,17 +43,13 @@ class APITest extends IntegrationTestCase */ public function test_addGoal_handlesAppropriatePatternTypesForNumericAttributes($matchAttribute, $patternType, $pattern, $expectException) { - try { - $this->api->addGoal($this->idSite, 'test goal', $matchAttribute, $pattern, $patternType); - - if ($expectException) { - $this->fail('addGoal should have failed'); - } - } catch (\Exception $ex) { - if (!$expectException) { - throw $ex; - } + if ($expectException) { + $this->expectException(\Exception::class); + } else { + $this->expectNotToPerformAssertions(); } + + $this->api->addGoal($this->idSite, 'test goal', $matchAttribute, $pattern, $patternType); } public function getTestDataForNumericMatchAttribute() |