Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Goals/tests/Integration/APITest.php')
-rw-r--r--plugins/Goals/tests/Integration/APITest.php16
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()