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 'tests/PHPUnit/Unit/Category/CategoryTest.php')
-rw-r--r--tests/PHPUnit/Unit/Category/CategoryTest.php9
1 files changed, 4 insertions, 5 deletions
diff --git a/tests/PHPUnit/Unit/Category/CategoryTest.php b/tests/PHPUnit/Unit/Category/CategoryTest.php
index 39ae0bfb92..6d475c08a3 100644
--- a/tests/PHPUnit/Unit/Category/CategoryTest.php
+++ b/tests/PHPUnit/Unit/Category/CategoryTest.php
@@ -23,7 +23,7 @@ class CategoryTest extends \PHPUnit\Framework\TestCase
*/
private $category;
- public function setUp()
+ public function setUp(): void
{
parent::setUp();
$this->category = new Category();
@@ -76,12 +76,11 @@ class CategoryTest extends \PHPUnit\Framework\TestCase
$this->assertSame(array($subcategory1, $subcategory2), $this->category->getSubcategories());
}
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage Subcategory id1 already exists
- */
public function test_addSubcategory_ShouldThrowException_WhenAddingSubcategoryWithSameIdTwice()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Subcategory id1 already exists');
+
$subcategory1 = $this->createSubcategory('id1', 'name1');
$subcategory2 = $this->createSubcategory('id1', 'name2');