diff --git a/test/core/TagSetFieldDataTest.php b/test/core/TagSetFieldDataTest.php index eb762a24f..9c55a8d00 100644 --- a/test/core/TagSetFieldDataTest.php +++ b/test/core/TagSetFieldDataTest.php @@ -119,17 +119,8 @@ class TagSetFieldDataTest extends ItopDataTestCase $oObjWithTagSet->DBWrite(); // Try to delete the tag, must complain ! - try - { - $oTagData->DBDelete(); - } catch (DeleteException $e) - { - static::assertTrue(true); - - return; - } - // Should not pass here - static::assertFalse(true); + $this->expectException(DeleteException::class); + $oTagData->DBDelete(); } /** @@ -217,19 +208,9 @@ class TagSetFieldDataTest extends ItopDataTestCase $oObjWithTagSet->DBWrite(); // Try to change the code of the tag, must complain ! - try - { - $oTagData->Set('code', 'tag1'); - $oTagData->DBWrite(); - - } catch (CoreException $e) - { - static::assertTrue(true); - - return; - } - // Should not pass here - static::assertFalse(true); + $oTagData->Set('code', 'tag1'); + $this->expectException(CoreException::class); + $oTagData->DBWrite(); } /**