- */
class ilBuddySystemUnlinkedStateRelationTest extends ilBuddySystemBaseStateTestCase
{
public function getInitialState(): ilBuddySystemRelationState
diff --git a/components/ILIAS/Container/Content/ObjectiveView/class.ObjectiveRenderer.php b/components/ILIAS/Container/Content/ObjectiveView/class.ObjectiveRenderer.php
index c726938e0b1c..0618566c71b4 100755
--- a/components/ILIAS/Container/Content/ObjectiveView/class.ObjectiveRenderer.php
+++ b/components/ILIAS/Container/Content/ObjectiveView/class.ObjectiveRenderer.php
@@ -262,7 +262,6 @@ protected function renderTest(
}
$node_data['title'] = $title;
-
return "" . $this->renderer->getItemRenderer()->renderItem($node_data) . "
";
}
diff --git a/components/ILIAS/Container/Content/ObjectiveView/class.ilContainerObjectiveGUI.php b/components/ILIAS/Container/Content/ObjectiveView/class.ilContainerObjectiveGUI.php
index 9bdc5313d1c9..c2cd20fb9a5d 100755
--- a/components/ILIAS/Container/Content/ObjectiveView/class.ilContainerObjectiveGUI.php
+++ b/components/ILIAS/Container/Content/ObjectiveView/class.ilContainerObjectiveGUI.php
@@ -45,7 +45,6 @@ public function __construct(
\ILIAS\Container\Content\ItemPresentationManager $item_presentation
) {
global $DIC;
-
$this->tabs = $DIC->tabs();
$this->toolbar = $DIC->toolbar();
$this->logger = $DIC->logger()->crs();
@@ -161,6 +160,16 @@ public function getMainContent(): string
return $tpl->get();
}
+ public function initRenderer(): void
+ {
+ parent::initRenderer();
+ $this->loc_settings = ilLOSettings::getInstanceByObjId($this->getContainerObject()->getId());
+ $this->objective_map = $this->buildObjectiveMap();
+ $this->renderer->setItemModifierClosure(function (ilObjectListGUI $a_item_list_gui, array $a_item) {
+ $this->addItemDetails($a_item_list_gui, $a_item);
+ });
+ }
+
public function renderItemList(): string
{
$this->initRenderer();
@@ -468,9 +477,7 @@ protected function addItemDetails(ilObjectListGUI $a_item_list_gui, array $a_ite
$lng = $this->lng;
$ilCtrl = $this->ctrl;
$ilUser = $this->user;
-
$item_ref_id = $a_item["ref_id"];
-
if (is_array($this->objective_map)) {
$details = [];
if (isset($this->objective_map["material"][$item_ref_id])) {
diff --git a/components/ILIAS/Container/Content/class.ItemRenderer.php b/components/ILIAS/Container/Content/class.ItemRenderer.php
index 1c5bf5e1a835..2e78e6ad2dd2 100755
--- a/components/ILIAS/Container/Content/class.ItemRenderer.php
+++ b/components/ILIAS/Container/Content/class.ItemRenderer.php
@@ -38,6 +38,7 @@ class ItemRenderer
protected string $view_mode;
protected InternalGUIService $gui;
protected InternalDomainService $domain;
+ protected ?\Closure $item_modifier_closure = null;
protected array $list_gui = [];
public function __construct(
@@ -140,8 +141,9 @@ public function renderItem(
}
}
- if (method_exists($this, "addItemDetails")) {
- $this->addItemDetails($item_list_gui, $a_item_data);
+ if ($this->item_modifier_closure instanceof \Closure) {
+ $c = $this->item_modifier_closure;
+ $c($item_list_gui, $a_item_data);
}
// show subitems of sessions
@@ -239,6 +241,11 @@ public function renderItem(
return $html;
}
+ public function setItemModifierClosure(\Closure $f): void
+ {
+ $this->item_modifier_closure = $f;
+ }
+
public function renderCard(
array $a_item_data,
int $a_position = 0,
diff --git a/components/ILIAS/Container/Content/class.ilContainerRenderer.php b/components/ILIAS/Container/Content/class.ilContainerRenderer.php
index 75e2775f0fbb..57965a272ba2 100755
--- a/components/ILIAS/Container/Content/class.ilContainerRenderer.php
+++ b/components/ILIAS/Container/Content/class.ilContainerRenderer.php
@@ -67,6 +67,7 @@ class ilContainerRenderer
protected ?Closure $block_prefix_closure = null;
protected ?Closure $block_postfix_closure = null;
protected ?Closure $item_hidden_closure = null;
+ protected ?Closure $item_modifier_closure = null;
protected \ILIAS\Container\Content\BlockSessionRepository $block_repo;
public function __construct(
@@ -145,6 +146,12 @@ public function setItemHiddenClosure(Closure $f): void
$this->item_hidden_closure = $f;
}
+ public function setItemModifierClosure(Closure $f): void
+ {
+ $this->item_renderer->setItemModifierClosure($f);
+ $this->item_modifier_closure = $f;
+ }
+
protected function getViewMode(): int
{
return $this->view_mode;
diff --git a/components/ILIAS/ContentPage/classes/class.ilContentPagePageConfig.php b/components/ILIAS/ContentPage/classes/class.ilContentPagePageConfig.php
index ae559088f6ef..40bb5f394f63 100755
--- a/components/ILIAS/ContentPage/classes/class.ilContentPagePageConfig.php
+++ b/components/ILIAS/ContentPage/classes/class.ilContentPagePageConfig.php
@@ -28,6 +28,7 @@ public function init(): void
$this->setEnablePermissionChecks(true);
$this->setMultiLangSupport(true);
$this->setUsePageContainer(false);
+ $this->setEnableAnchors(true);
$this->setEnablePCType('Map', true);
$mediaPoolSettings = new ilSetting('mobs');
diff --git a/components/ILIAS/ContentPage/tests/PageReadingTimeTest.php b/components/ILIAS/ContentPage/tests/PageReadingTimeTest.php
index 6638e06c028b..c5e8e70c2311 100755
--- a/components/ILIAS/ContentPage/tests/PageReadingTimeTest.php
+++ b/components/ILIAS/ContentPage/tests/PageReadingTimeTest.php
@@ -24,11 +24,8 @@
use PHPUnit\Framework\TestCase;
use TypeError;
use stdClass;
+use PHPUnit\Framework\Attributes\DataProvider;
-/**
- * Class PageReadingTimeTest
- * @author Michael Jansen
- */
class PageReadingTimeTest extends TestCase
{
public static function mixedReadingTypesProvider(): array
@@ -44,11 +41,8 @@ public static function mixedReadingTypesProvider(): array
];
}
- /**
- * @param mixed $mixedType
- * @dataProvider mixedReadingTypesProvider
- */
- public function testPageReadingTimeValueThrowsExceptionWhenConstructedWithInvalidTypes($mixedType): void
+ #[DataProvider('mixedReadingTypesProvider')]
+ public function testPageReadingTimeValueThrowsExceptionWhenConstructedWithInvalidTypes(mixed $mixedType): void
{
$this->expectException(TypeError::class);
diff --git a/components/ILIAS/Course/classes/class.ilCourseExporter.php b/components/ILIAS/Course/classes/class.ilCourseExporter.php
index c1353d5cf2ae..b1b67514bf90 100755
--- a/components/ILIAS/Course/classes/class.ilCourseExporter.php
+++ b/components/ILIAS/Course/classes/class.ilCourseExporter.php
@@ -17,15 +17,15 @@
*********************************************************************/
declare(strict_types=0);
+
/**
* Folder export
* @author Stefan Meyer
- * @ingroup ServicesBooking
*/
class ilCourseExporter extends ilXmlExporter
{
- public const ENTITY_OBJECTIVE = 'objectives';
- public const ENTITY_MAIN = 'crs';
+ public const string ENTITY_OBJECTIVE = 'objectives';
+ public const string ENTITY_MAIN = 'crs';
protected ilXmlWriter $writer;
protected ilLogger $logger;
@@ -178,19 +178,26 @@ public function getXmlRepresentation(string $a_entity, string $a_schema_version,
public function getValidSchemaVersions(string $a_entity): array
{
return [
+ "11.0" => [
+ "namespace" => 'http://www.ilias.de/Modules/Course/crs/11',
+ "xsd_file" => 'ilias_crs_11_0.xsd',
+ "uses_dataset" => false,
+ "min" => "11.0",
+ "max" => ""
+ ],
"10.0" => [
"namespace" => 'http://www.ilias.de/Modules/Course/crs/10',
- "xsd_file" => 'ilias_crs_10.xsd',
+ "xsd_file" => 'ilias_crs_10_0.xsd',
"uses_dataset" => false,
"min" => "10.0",
- "max" => ""
+ "max" => "10.999"
],
"9.0" => [
"namespace" => 'http://www.ilias.de/Modules/Course/crs/9',
"xsd_file" => 'ilias_crs_9_0.xsd',
"uses_dataset" => false,
"min" => "9.0",
- "max" => ""
+ "max" => "9.999"
],
"4.1.0" => [
"namespace" => "http://www.ilias.de/Modules/Course/crs/4_1",
@@ -204,7 +211,7 @@ public function getValidSchemaVersions(string $a_entity): array
"xsd_file" => "ilias_crs_5_0.xsd",
"uses_dataset" => false,
"min" => "5.0.0",
- "max" => ""
+ "max" => "8.999"
]
];
}
diff --git a/components/ILIAS/Course/classes/class.ilCourseXMLParser.php b/components/ILIAS/Course/classes/class.ilCourseXMLParser.php
index 89f55dc4e4da..369bca67e41b 100755
--- a/components/ILIAS/Course/classes/class.ilCourseXMLParser.php
+++ b/components/ILIAS/Course/classes/class.ilCourseXMLParser.php
@@ -17,20 +17,18 @@
*********************************************************************/
declare(strict_types=0);
+
/**
* Course XML Parser
* @author Stefan Meyer
- * @version $Id$
- * @extends ilMDSaxParser
*/
-class ilCourseXMLParser extends ilMDSaxParser implements ilSaxSubsetParser
+class ilCourseXMLParser extends ilSaxParser implements ilSaxSubsetParser
{
- public const MODE_SOAP = 1;
- public const MODE_EXPORT = 2;
+ public const int MODE_SOAP = 1;
+ public const int MODE_EXPORT = 2;
private int $mode = self::MODE_EXPORT;
- private bool $in_meta_data = false;
private bool $in_availability = false;
private bool $in_registration = false;
private bool $in_period = false;
@@ -45,10 +43,6 @@ class ilCourseXMLParser extends ilMDSaxParser implements ilSaxSubsetParser
private ?ilObjCourse $course_obj;
private ?ilLogger $log;
protected ilSetting $setting;
- /**
- * @var false
- */
- protected ?ilMD $md_obj = null;
protected ilSaxController $sax_controller;
protected ilCourseParticipants $course_members;
protected ilCourseWaitingList $course_waiting_list;
@@ -68,9 +62,6 @@ public function __construct(ilObjCourse $a_course_obj, string $a_xml_file = '')
$this->course_waiting_list = new ilCourseWaitingList($this->course_obj->getId());
// flip the array so we can use array_key_exists
$this->course_members_array = array_flip($this->course_members->getParticipants());
-
- $this->md_obj = new ilMD($this->course_obj->getId(), 0, 'crs');
- $this->setMDObject($this->md_obj);
}
public function setMode(int $a_mode): void
@@ -83,23 +74,6 @@ public function getMode(): int
return $this->mode;
}
- public function startParsing(): void
- {
- parent::startParsing();
-
- // rewrite autogenerated entry
- $general = $this->getMDObject()->getGeneral();
- $identifier_ids = $general->getIdentifierIds();
- if (!isset($identifier_ids[0])) {
- return;
- }
- $identifier = $general->getIdentifier($identifier_ids[0]);
- $identifier->setEntry(
- 'il__' . $this->getMDObject()->getObjType() . '_' . $this->getMDObject()->getObjId()
- );
- $identifier->update();
- }
-
/**
* @inheritDoc
*/
@@ -119,10 +93,6 @@ public function setHandlers($a_xml_parser): void
public function handlerBeginTag($a_xml_parser, string $a_name, array $a_attribs): void
{
$a_attribs = $this->trimAndStripAttribs($a_attribs);
- if ($this->in_meta_data) {
- parent::handlerBeginTag($a_xml_parser, $a_name, $a_attribs);
- return;
- }
switch ($a_name) {
case 'Course':
@@ -275,11 +245,6 @@ public function handlerBeginTag($a_xml_parser, string $a_name, array $a_attribs)
$this->course_obj->setSubscriptionLimitationType(ilCourseConstants::IL_CRS_SUBSCRIPTION_DEACTIVATED);
break;
- case "MetaData":
- $this->in_meta_data = true;
- parent::handlerBeginTag($a_xml_parser, $a_name, $a_attribs);
- break;
-
case 'ContainerSetting':
$this->current_container_setting = ($a_attribs['id'] ?? '');
break;
@@ -508,24 +473,14 @@ private function handleWaitingList(array $a_attribs, array $id_data): void
*/
public function handlerEndTag($a_xml_parser, string $a_name): void
{
- $this->cdata = $this->trimAndStrip((string) $this->cdata);
- if ($this->in_meta_data) {
- parent::handlerEndTag($a_xml_parser, $a_name);
- }
+ $this->cdata = $this->trimAndStrip($this->cdata);
switch ($a_name) {
case 'Course':
$this->log->write('CourseXMLParser: import_id = ' . $this->course_obj->getImportId());
- /*
- * This needs to be before MDUpdateListener, since otherwise container settings are
- * overwritten by ilContainer::update in MDUpdateListener, see #24733.
- */
+
$this->course_obj->readContainerSettings();
- if ($this->getMode() === self::MODE_SOAP) {
- $this->course_obj->MDUpdateListener('General');
- $this->adv_md_handler->save();
- }
// see #26169
$transl = ilObjectTranslation::getInstance($this->course_obj->getId());
if ($transl->getDefaultTitle() !== "") {
@@ -537,6 +492,18 @@ public function handlerEndTag($a_xml_parser, string $a_name): void
$this->course_obj->update();
break;
+ case "Title":
+ $transl = ilObjectTranslation::getInstance($this->course_obj->getId());
+ $this->course_obj->setTitle(trim($this->cdata));
+ $transl->setDefaultTitle(trim($this->cdata));
+ break;
+
+ case "Description":
+ $transl = ilObjectTranslation::getInstance($this->course_obj->getId());
+ $this->course_obj->setDescription(trim($this->cdata));
+ $transl->setDefaultDescription(trim($this->cdata));
+ break;
+
case 'Settings':
break;
@@ -624,11 +591,6 @@ public function handlerEndTag($a_xml_parser, string $a_name): void
$this->course_obj->setSubscriptionPassword(trim($this->cdata));
break;
- case 'MetaData':
- $this->in_meta_data = false;
- parent::handlerEndTag($a_xml_parser, $a_name);
- break;
-
case 'ContainerSetting':
if ($this->current_container_setting) {
ilContainer::_writeContainerSetting(
@@ -683,10 +645,6 @@ public function handlerEndTag($a_xml_parser, string $a_name): void
public function handlerCharacterData($a_xml_parser, string $a_data): void
{
- // call meta data handler
- if ($this->in_meta_data) {
- parent::handlerCharacterData($a_xml_parser, $a_data);
- }
if ($a_data != "\n") {
// Replace multiple tabs with one space
$a_data = preg_replace("/\t+/", " ", $a_data);
@@ -694,4 +652,18 @@ public function handlerCharacterData($a_xml_parser, string $a_data): void
$this->cdata .= $a_data;
}
}
+
+ protected function trimAndStripAttribs(array $attribs): array
+ {
+ $ret = [];
+ foreach ($attribs as $k => $v) {
+ $ret[$k] = $this->trimAndStrip((string) $v);
+ }
+ return $ret;
+ }
+
+ protected function trimAndStrip(string $input): string
+ {
+ return ilUtil::stripSlashes(trim($input));
+ }
}
diff --git a/components/ILIAS/Course/classes/class.ilCourseXMLWriter.php b/components/ILIAS/Course/classes/class.ilCourseXMLWriter.php
index a69245a1a176..d8a715295b82 100755
--- a/components/ILIAS/Course/classes/class.ilCourseXMLWriter.php
+++ b/components/ILIAS/Course/classes/class.ilCourseXMLWriter.php
@@ -26,14 +26,13 @@
* The author is responsible for well-formedness and validity
* of the xml document.
* @author Stefan Meyer
- * @version $Id$
*/
class ilCourseXMLWriter extends ilXmlWriter
{
- public const MODE_SOAP = 1;
- public const MODE_EXPORT = 2;
+ public const int MODE_SOAP = 1;
+ public const int MODE_EXPORT = 2;
- public const EXPORT_VERSION = '8.0';
+ public const string EXPORT_VERSION = '8.0';
private int $mode = self::MODE_SOAP;
@@ -70,8 +69,8 @@ public function start(): void
if ($this->getMode() == self::MODE_SOAP) {
$this->__buildHeader();
$this->__buildCourseStart();
- $this->__buildMetaData();
$this->__buildAdvancedMetaData();
+ $this->__buildTitleDescription();
if ($this->attach_users) {
$this->__buildAdmin();
$this->__buildTutor();
@@ -114,6 +113,15 @@ public function __buildHeader(): void
$this->xmlHeader();
}
+ public function __buildTitleDescription(): void
+ {
+ $this->xmlElement('Title', null, $this->course_obj->getTitle());
+
+ if ($desc = $this->course_obj->getDescription()) {
+ $this->xmlElement('Description', null, $desc);
+ }
+ }
+
public function __buildCourseStart(): void
{
$attrs["exportVersion"] = self::EXPORT_VERSION;
@@ -122,13 +130,6 @@ public function __buildCourseStart(): void
$this->xmlStartTag("Course", $attrs);
}
- public function __buildMetaData(): void
- {
- $md2xml = new ilMD2XML($this->course_obj->getId(), $this->course_obj->getId(), 'crs');
- $md2xml->startExport();
- $this->appendXML($md2xml->getXML());
- }
-
private function __buildAdvancedMetaData(): void
{
ilAdvancedMDValues::_appendXMLByObjId($this, $this->course_obj->getId());
diff --git a/components/ILIAS/Course/classes/class.ilObjCourse.php b/components/ILIAS/Course/classes/class.ilObjCourse.php
index 48cefd180192..da76ef667f3c 100755
--- a/components/ILIAS/Course/classes/class.ilObjCourse.php
+++ b/components/ILIAS/Course/classes/class.ilObjCourse.php
@@ -22,17 +22,17 @@
*/
class ilObjCourse extends ilContainer implements ilMembershipRegistrationCodes
{
- public const CAL_REG_START = 1;
- public const CAL_REG_END = 2;
- public const CAL_ACTIVATION_START = 3;
- public const CAL_ACTIVATION_END = 4;
- public const CAL_COURSE_START = 5;
- public const CAL_COURSE_END = 6;
- public const CAL_COURSE_TIMING_START = 7;
- public const CAL_COURSE_TIMING_END = 8;
-
- public const STATUS_DETERMINATION_LP = 1;
- public const STATUS_DETERMINATION_MANUAL = 2;
+ public const int CAL_REG_START = 1;
+ public const int CAL_REG_END = 2;
+ public const int CAL_ACTIVATION_START = 3;
+ public const int CAL_ACTIVATION_END = 4;
+ public const int CAL_COURSE_START = 5;
+ public const int CAL_COURSE_END = 6;
+ public const int CAL_COURSE_TIMING_START = 7;
+ public const int CAL_COURSE_TIMING_END = 8;
+
+ public const int STATUS_DETERMINATION_LP = 1;
+ public const int STATUS_DETERMINATION_MANUAL = 2;
private string $contact_consultation = '';
private string $contact_phone = '';
@@ -578,17 +578,15 @@ public function read(): void
$this->__readSettings();
}
- public function create($a_upload = false): int
+ public function create(): int
{
global $DIC;
$ilAppEventHandler = $DIC['ilAppEventHandler'];
- $id = parent::create($a_upload);
+ $id = parent::create();
- if (!$a_upload) {
- $this->createMetaData();
- }
+ $this->createMetaData();
$this->__createDefaultSettings();
$this->app_event_handler->raise(
'components/ILIAS/Course',
@@ -730,17 +728,12 @@ public function hasWaitingListAutoFill(): bool
/**
* Clone course (no member data)
- *
- * @access public
- * @param int target ref_id
- * @param int copy id
- *
*/
- public function cloneObject(int $a_target_id, int $a_copy_id = 0, bool $a_omit_tree = false): ?ilObject
+ public function cloneObject(int $target_id, int $copy_id = 0, bool $omit_tree = false): ?ilObject
{
global $DIC;
- $new_obj = parent::cloneObject($a_target_id, $a_copy_id, $a_omit_tree);
+ $new_obj = parent::cloneObject($target_id, $copy_id, $omit_tree);
$this->cloneAutoGeneratedRoles($new_obj);
$this->cloneMetaData($new_obj);
@@ -748,7 +741,7 @@ public function cloneObject(int $a_target_id, int $a_copy_id = 0, bool $a_omit_t
$new_obj->getMemberObject()->add($this->user->getId(), ilParticipants::IL_CRS_ADMIN);
$new_obj->getMemberObject()->updateContact($this->user->getId(), 1);
- $cwo = ilCopyWizardOptions::_getInstance($a_copy_id);
+ $cwo = ilCopyWizardOptions::_getInstance($copy_id);
if ($cwo->isRootNode($this->getRefId())) {
$this->setOfflineStatus(true);
}
@@ -784,29 +777,29 @@ public function cloneObject(int $a_target_id, int $a_copy_id = 0, bool $a_omit_t
/**
* @inheritDoc
*/
- public function cloneDependencies(int $a_target_id, int $a_copy_id): bool
+ public function cloneDependencies(int $target_id, int $copy_id): bool
{
- parent::cloneDependencies($a_target_id, $a_copy_id);
+ parent::cloneDependencies($target_id, $copy_id);
// Clone course start objects
$start = new ilContainerStartObjects($this->getRefId(), $this->getId());
- $start->cloneDependencies($a_target_id, $a_copy_id);
+ $start->cloneDependencies($target_id, $copy_id);
// Clone course item settings
- ilObjectActivation::cloneDependencies($this->getRefId(), $a_target_id, $a_copy_id);
+ ilObjectActivation::cloneDependencies($this->getRefId(), $target_id, $copy_id);
// clone objective settings
- ilLOSettings::cloneSettings($a_copy_id, $this->getId(), ilObject::_lookupObjId($a_target_id));
+ ilLOSettings::cloneSettings($copy_id, $this->getId(), ilObject::_lookupObjId($target_id));
// Clone course learning objectives
$crs_objective = new ilCourseObjective($this);
- $crs_objective->ilClone($a_target_id, $a_copy_id);
+ $crs_objective->ilClone($target_id, $copy_id);
// clone membership limitation
foreach (\ilObjCourseGrouping::_getGroupings($this->getId()) as $grouping_id) {
$this->course_logger->info('Handling grouping id: ' . $grouping_id);
$grouping = new \ilObjCourseGrouping($grouping_id);
- $grouping->cloneGrouping($a_target_id, $a_copy_id);
+ $grouping->cloneGrouping($target_id, $copy_id);
}
return true;
}
@@ -900,9 +893,7 @@ public function hasContactData(): bool
/**
* delete course and all related data
- *
- * @access public
- * @return boolean true if all object data were removed; false if only a references were removed
+ * return true if all object data were removed; false if only a references were removed
*/
public function delete(): bool
{
@@ -1029,7 +1020,7 @@ public function updateSettings(): void
'integer'
) . ', ' .
'min_members = ' . $this->db->quote($this->getSubscriptionMinMembers(), 'integer') . ' ' .
- "WHERE obj_id = " . $this->db->quote($this->getId(), 'integer') . "";
+ "WHERE obj_id = " . $this->db->quote($this->getId(), 'integer');
$res = $this->db->manipulate($query);
@@ -1302,9 +1293,9 @@ public function initDefaultRoles(): void
* Each permission is granted by computing the intersection of the
* template il_crs_non_member and the permission template of the parent role.
*/
- public function setParentRolePermissions(int $a_parent_ref): bool
+ public function setParentRolePermissions(int $parent_ref_id): bool
{
- $parent_roles = $this->rbac_review->getParentRoleIds($a_parent_ref);
+ $parent_roles = $this->rbac_review->getParentRoleIds($parent_ref_id);
foreach ($parent_roles as $parent_role) {
$this->rbac_admin->initIntersectionPermissions(
$this->getRefId(),
@@ -1353,7 +1344,7 @@ public function getLocalCourseRoles($a_translate = false): array
$role_arr = $this->rbac_review->getRolesOfRoleFolder($this->getRefId());
foreach ($role_arr as $role_id) {
- if ($this->rbac_review->isAssignable($role_id, $this->getRefId()) == true) {
+ if ($this->rbac_review->isAssignable($role_id, $this->getRefId())) {
$role_Obj = ilObjectFactory::getInstanceByObjId($role_id);
if ($a_translate) {
$role_name = ilObjRole::_getTranslation($role_Obj->getTitle());
diff --git a/components/ILIAS/Cron/tests/CronJobEntityTest.php b/components/ILIAS/Cron/tests/CronJobEntityTest.php
index 46e5c76e0c58..3fcad259440f 100755
--- a/components/ILIAS/Cron/tests/CronJobEntityTest.php
+++ b/components/ILIAS/Cron/tests/CronJobEntityTest.php
@@ -23,12 +23,10 @@
use ILIAS\Cron\Job\JobEntity;
use ILIAS\Cron\Job\JobResult;
use ILIAS\Cron\CronJob;
+use PHPUnit\Framework\Attributes\Depends;
class CronJobEntityTest extends TestCase
{
- /**
- * @param CronJob|null $job_instance
- */
private function getEntity(
?CronJob $job_instance = null,
?int $schedule_type = null,
@@ -73,9 +71,7 @@ public function testEntityCollectionCanBeCreatedWithItems(): \ILIAS\Cron\Job\Col
return $entities;
}
- /**
- * @depends testEntityCollectionCanBeCreatedWithItems
- */
+ #[Depends('testEntityCollectionCanBeCreatedWithItems')]
public function testCollectionCanBeChanged(
\ILIAS\Cron\Job\Collection\JobEntities $entities
): \ILIAS\Cron\Job\Collection\JobEntities {
@@ -86,9 +82,7 @@ public function testCollectionCanBeChanged(
return $entities;
}
- /**
- * @depends testCollectionCanBeChanged
- */
+ #[Depends('testCollectionCanBeChanged')]
public function testCollectionCanBeFilteredAndSliced(\ILIAS\Cron\Job\Collection\JobEntities $entities): void
{
$this->assertCount(0, $entities->filter(static function (JobEntity $entity): bool {
diff --git a/components/ILIAS/Cron/tests/CronJobScheduleTest.php b/components/ILIAS/Cron/tests/CronJobScheduleTest.php
index cd137a5add00..2405b4806218 100755
--- a/components/ILIAS/Cron/tests/CronJobScheduleTest.php
+++ b/components/ILIAS/Cron/tests/CronJobScheduleTest.php
@@ -22,6 +22,7 @@
use ILIAS\Cron\Job\Schedule\JobScheduleType;
use ILIAS\Cron\Job\JobResult;
use ILIAS\Cron\CronJob;
+use PHPUnit\Framework\Attributes\DataProvider;
class CronJobScheduleTest extends TestCase
{
@@ -434,9 +435,9 @@ function (): DateTimeImmutable {
}
/**
- * @dataProvider jobProvider
* @param null|callable(): DateTimeImmutable $last_run_datetime_callable
*/
+ #[DataProvider('jobProvider')]
public function testSchedule(
CronJob $job_instance,
bool $is_manual_run,
@@ -575,9 +576,9 @@ function (): DateTimeImmutable {
}
/**
- * @dataProvider weeklyScheduleProvider
* @param callable(): DateTimeImmutable $last_run_datetime_provider
*/
+ #[DataProvider('weeklyScheduleProvider')]
public function testWeeklySchedules(
CronJob $job_instance,
callable $last_run_datetime_provider,
diff --git a/components/ILIAS/Data/tests/ClientIdTest.php b/components/ILIAS/Data/tests/ClientIdTest.php
index 65e6cc9f59f4..cab201255fcf 100755
--- a/components/ILIAS/Data/tests/ClientIdTest.php
+++ b/components/ILIAS/Data/tests/ClientIdTest.php
@@ -71,20 +71,14 @@ public static function invalidClientIdProvider(): array
];
}
- /**
- * @param string $value
- * @dataProvider clientIdProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('clientIdProvider')]
public function testValidArguments(string $value): void
{
$clientId = $this->f->clientId($value);
$this->assertEquals($value, $clientId->toString());
}
- /**
- * @param string $value
- * @dataProvider invalidClientIdProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('invalidClientIdProvider')]
public function testInvalidArguments(string $value): void
{
try {
diff --git a/components/ILIAS/Data/tests/DataSizeTest.php b/components/ILIAS/Data/tests/DataSizeTest.php
index aa57eebef746..eb16f107329a 100755
--- a/components/ILIAS/Data/tests/DataSizeTest.php
+++ b/components/ILIAS/Data/tests/DataSizeTest.php
@@ -48,9 +48,7 @@ public static function provideDataSizes(): array
];
}
- /**
- * @dataProvider provideDataSizes
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('provideDataSizes')]
public function testDifferentDataSizes(int $bytes, string $expected_representation): void
{
$datasize = new DataSize($bytes, DataSize::Byte);
@@ -58,9 +56,7 @@ public function testDifferentDataSizes(int $bytes, string $expected_representati
$this->assertEquals($expected_representation, $datasize->__toString());
}
- /**
- * @dataProvider tDataProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('tDataProvider')]
public function test_normal($a, $b, $expected, $expected_in_bytes): void
{
$ds = new DataSize($a, $b);
diff --git a/components/ILIAS/Data/tests/LanguageTagTest.php b/components/ILIAS/Data/tests/LanguageTagTest.php
index 004331be1e05..4883d48ad988 100755
--- a/components/ILIAS/Data/tests/LanguageTagTest.php
+++ b/components/ILIAS/Data/tests/LanguageTagTest.php
@@ -32,9 +32,7 @@ public function testFromString(): void
$this->assertInstanceOf(LanguageTag::class, $tag);
}
- /**
- * @dataProvider saveToRun
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('SaveToRun')]
public function testParse(string $input, bool $isOk): void
{
if (!$isOk) {
@@ -44,9 +42,7 @@ public function testParse(string $input, bool $isOk): void
$this->assertInstanceOf(LanguageTag::class, $tag);
}
- /**
- * @dataProvider risky
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('risky')]
public function testRisky(string $input, bool $isOk): void
{
$this->testParse($input, $isOk);
diff --git a/components/ILIAS/Data/tests/LinkTest.php b/components/ILIAS/Data/tests/LinkTest.php
index fa32fa99729c..b666fd5febc9 100755
--- a/components/ILIAS/Data/tests/LinkTest.php
+++ b/components/ILIAS/Data/tests/LinkTest.php
@@ -44,9 +44,7 @@ public function testFactory(): Link
return $link;
}
- /**
- * @depends testFactory
- */
+ #[\PHPUnit\Framework\Attributes\Depends('testFactory')]
public function testValues(Link $link): void
{
$this->assertEquals(
diff --git a/components/ILIAS/Data/tests/OrderTest.php b/components/ILIAS/Data/tests/OrderTest.php
index 24b07f1e46a2..3aaeddc8a9b6 100755
--- a/components/ILIAS/Data/tests/OrderTest.php
+++ b/components/ILIAS/Data/tests/OrderTest.php
@@ -34,9 +34,7 @@ public function testFactory(): Order
return $order;
}
- /**
- * @depends testFactory
- */
+ #[\PHPUnit\Framework\Attributes\Depends('testFactory')]
public function testValues(Order $order): void
{
$this->assertEquals(
@@ -45,9 +43,7 @@ public function testValues(Order $order): void
);
}
- /**
- * @depends testFactory
- */
+ #[\PHPUnit\Framework\Attributes\Depends('testFactory')]
public function testAppend(Order $order): Order
{
$order = $order->append('sub2', Order::DESC);
@@ -61,9 +57,7 @@ public function testAppend(Order $order): Order
return $order;
}
- /**
- * @depends testFactory
- */
+ #[\PHPUnit\Framework\Attributes\Depends('testFactory')]
public function testJoinOne(Order $order): void
{
$this->assertEquals(
@@ -77,9 +71,7 @@ function ($pre, $k, $v) {
);
}
- /**
- * @depends testAppend
- */
+ #[\PHPUnit\Framework\Attributes\Depends('testAppend')]
public function testJoinMore(Order $order): void
{
$this->assertEquals(
@@ -93,18 +85,14 @@ function ($pre, $k, $v) {
);
}
- /**
- * @depends testFactory
- */
+ #[\PHPUnit\Framework\Attributes\Depends('testFactory')]
public function testInvalidDirection(Order $order): void
{
$this->expectException(TypeError::class);
$order = $order->append('sub3', -1);
}
- /**
- * @depends testFactory
- */
+ #[\PHPUnit\Framework\Attributes\Depends('testFactory')]
public function testInvalidSubject(Order $order): void
{
$this->expectException(InvalidArgumentException::class);
diff --git a/components/ILIAS/Data/tests/RangeTest.php b/components/ILIAS/Data/tests/RangeTest.php
index 93af3f8d8e09..3d48dc9ea291 100755
--- a/components/ILIAS/Data/tests/RangeTest.php
+++ b/components/ILIAS/Data/tests/RangeTest.php
@@ -34,26 +34,20 @@ public function testFactory(): Range
return $range;
}
- /**
- * @depends testFactory
- */
+ #[\PHPUnit\Framework\Attributes\Depends('testFactory')]
public function testValues(Range $range): void
{
$this->assertEquals(1, $range->getStart());
$this->assertEquals(2, $range->getLength());
}
- /**
- * @depends testFactory
- */
+ #[\PHPUnit\Framework\Attributes\Depends('testFactory')]
public function testEndCalculation(Range $range): void
{
$this->assertEquals(3, $range->getEnd());
}
- /**
- * @depends testFactory
- */
+ #[\PHPUnit\Framework\Attributes\Depends('testFactory')]
public function testWithLength(Range $range): Range
{
$range = $range->withLength(3);
@@ -63,9 +57,7 @@ public function testWithLength(Range $range): Range
return $range;
}
- /**
- * @depends testWithLength
- */
+ #[\PHPUnit\Framework\Attributes\Depends('testWithLength')]
public function testWithStart(Range $range): Range
{
$range = $range->withStart(3);
@@ -75,9 +67,7 @@ public function testWithStart(Range $range): Range
return $range;
}
- /**
- * @depends testWithStart
- */
+ #[\PHPUnit\Framework\Attributes\Depends('testWithStart')]
public function testUnpack(Range $range): void
{
$this->assertEquals(
@@ -86,18 +76,14 @@ public function testUnpack(Range $range): void
);
}
- /**
- * @depends testFactory
- */
+ #[\PHPUnit\Framework\Attributes\Depends('testFactory')]
public function testNegativeStart(Range $range): void
{
$this->expectException(InvalidArgumentException::class);
$range = $range->withStart(-5);
}
- /**
- * @depends testFactory
- */
+ #[\PHPUnit\Framework\Attributes\Depends('testFactory')]
public function testNegativeLength(Range $range): void
{
$this->expectException(InvalidArgumentException::class);
@@ -118,9 +104,7 @@ public function testConstructionWrongLength(): void
$range = $f->range(1, -2);
}
- /**
- * @dataProvider cropCases
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('cropCases')]
public function testCroppedTo($start, $length, $max, $has_changed): void
{
$f = new ILIAS\Data\Factory();
diff --git a/components/ILIAS/Data/tests/Text/Shape/MarkdownShapeTest.php b/components/ILIAS/Data/tests/Text/Shape/MarkdownShapeTest.php
index 411d215b808b..039cfbadabbf 100644
--- a/components/ILIAS/Data/tests/Text/Shape/MarkdownShapeTest.php
+++ b/components/ILIAS/Data/tests/Text/Shape/MarkdownShapeTest.php
@@ -66,18 +66,14 @@ public static function stringToPlainDataProvider(): array
];
}
- /**
- * @dataProvider stringToHTMLDataProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('stringToHTMLDataProvider')]
public function testToHTML(string $markdown_string, HTML $expected_html): void
{
$text = $this->markdown_shape->fromString($markdown_string);
$this->assertEquals($expected_html, $this->markdown_shape->toHTML($text));
}
- /**
- * @dataProvider stringToPlainDataProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('stringToPlainDataProvider')]
public function testToPlainText(string $markdown_string, PlainText $expected_text): void
{
$text = $this->markdown_shape->fromString($markdown_string);
diff --git a/components/ILIAS/Data/tests/Text/Shape/SimpleDocumentMarkdownShapeTest.php b/components/ILIAS/Data/tests/Text/Shape/SimpleDocumentMarkdownShapeTest.php
index cb05909558ab..8af338a1fe8b 100644
--- a/components/ILIAS/Data/tests/Text/Shape/SimpleDocumentMarkdownShapeTest.php
+++ b/components/ILIAS/Data/tests/Text/Shape/SimpleDocumentMarkdownShapeTest.php
@@ -68,9 +68,7 @@ public static function stringComplianceDataProvider(): array
];
}
- /**
- * @dataProvider constructDataProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('constructDataProvider')]
public function testGetSupportedStructure(
Structure $dp_bold,
Structure $dp_italic,
@@ -109,9 +107,7 @@ public function testGetSupportedStructure(
$this->assertEquals($expected, $supported_structure);
}
- /**
- * @dataProvider stringComplianceDataProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('stringComplianceDataProvider')]
public function testIsRawStringCompliant(string $markdown_string, bool $compliance): void
{
$this->assertEquals($this->simple_doc_markdown_shape->isRawStringCompliant($markdown_string), $compliance);
diff --git a/components/ILIAS/Data/tests/Text/Shape/WordOnlyMarkdownShapeTest.php b/components/ILIAS/Data/tests/Text/Shape/WordOnlyMarkdownShapeTest.php
index 341d3f43a854..f921f8b00dcf 100644
--- a/components/ILIAS/Data/tests/Text/Shape/WordOnlyMarkdownShapeTest.php
+++ b/components/ILIAS/Data/tests/Text/Shape/WordOnlyMarkdownShapeTest.php
@@ -56,9 +56,7 @@ public static function stringComplianceDataProvider(): array
];
}
- /**
- * @dataProvider constructDataProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('constructDataProvider')]
public function testGetSupportedStructure(Structure $dp_bold, Structure $dp_italic): void
{
$supported_structure = $this->word_only_markdown_shape->getSupportedStructure();
@@ -70,9 +68,7 @@ public function testGetSupportedStructure(Structure $dp_bold, Structure $dp_ital
$this->assertEquals($exptected, $supported_structure);
}
- /**
- * @dataProvider stringComplianceDataProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('stringComplianceDataProvider')]
public function testIsRawStringCompliant(string $markdown_string, bool $compliance): void
{
$this->assertEquals($compliance, $this->word_only_markdown_shape->isRawStringCompliant($markdown_string));
diff --git a/components/ILIAS/Data/tests/URITest.php b/components/ILIAS/Data/tests/URITest.php
index 0c9b62a741f6..cb017f6eb3da 100755
--- a/components/ILIAS/Data/tests/URITest.php
+++ b/components/ILIAS/Data/tests/URITest.php
@@ -83,17 +83,13 @@ class URITest extends TestCase
];
- /**
- * @doesNotPerformAssertions
- */
+ #[\PHPUnit\Framework\Attributes\DoesNotPerformAssertions]
public function test_init(): \ILIAS\Data\URI
{
return new ILIAS\Data\URI(self::URI_COMPLETE);
}
- /**
- * @depends test_init
- */
+ #[\PHPUnit\Framework\Attributes\Depends('test_init')]
public function test_ipv4(): void
{
$uri = new ILIAS\Data\URI(self::URI_COMPLETE_IPV4);
@@ -106,10 +102,8 @@ public function test_ipv4(): void
$this->assertEquals('fragment', $uri->getFragment());
}
- /**
- * @depends test_init
- * @dataProvider provideIPv6addresses
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('provideIPv6addresses')]
+ #[\PHPUnit\Framework\Attributes\Depends('test_init')]
public function testIPv6(string $host): void
{
$uri = new ILIAS\Data\URI('http://' . $host);
@@ -146,9 +140,7 @@ public static function provideIPv6addresses(): array
];
}
- /**
- * @depends test_init
- */
+ #[\PHPUnit\Framework\Attributes\Depends('test_init')]
public function test_localhost(): void
{
$uri = new ILIAS\Data\URI(self::URI_COMPLETE_LOCALHOST);
@@ -162,9 +154,7 @@ public function test_localhost(): void
}
- /**
- * @depends test_init
- */
+ #[\PHPUnit\Framework\Attributes\Depends('test_init')]
public function test_components($uri): void
{
$this->assertEquals('g+it', $uri->getSchema());
@@ -176,17 +166,13 @@ public function test_components($uri): void
$this->assertEquals('fragment', $uri->getFragment());
}
- /**
- * @depends test_init
- */
+ #[\PHPUnit\Framework\Attributes\Depends('test_init')]
public function test_base_uri($uri): void
{
$this->assertEquals('g+it://github.com:8080/someaccount/somerepo/somerepo.git', $uri->getBaseURI());
}
- /**
- * @depends test_init
- */
+ #[\PHPUnit\Framework\Attributes\Depends('test_init')]
public function test_base_uri_idempotent($uri): void
{
$base_uri = $uri->getBaseURI();
@@ -211,9 +197,7 @@ public function test_base_uri_idempotent($uri): void
}
- /**
- * @depends test_init
- */
+ #[\PHPUnit\Framework\Attributes\Depends('test_init')]
public function test_no_path(): void
{
$uri = new ILIAS\Data\URI(self::URI_NO_PATH_1);
@@ -235,9 +219,7 @@ public function test_no_path(): void
$this->assertEquals('fragment', $uri->getFragment());
}
- /**
- * @depends test_init
- */
+ #[\PHPUnit\Framework\Attributes\Depends('test_init')]
public function test_no_query(): void
{
$uri = new ILIAS\Data\URI(self::URI_NO_QUERY_1);
@@ -259,9 +241,7 @@ public function test_no_query(): void
$this->assertEquals('fragment', $uri->getFragment());
}
- /**
- * @depends test_init
- */
+ #[\PHPUnit\Framework\Attributes\Depends('test_init')]
public function test_authority_and_query(): void
{
$uri = new ILIAS\Data\URI(self::URI_AUTHORITY_AND_QUERY_1);
@@ -283,9 +263,7 @@ public function test_authority_and_query(): void
$this->assertNull($uri->getFragment());
}
- /**
- * @depends test_init
- */
+ #[\PHPUnit\Framework\Attributes\Depends('test_init')]
public function test_authority_and_fragment(): void
{
$uri = new ILIAS\Data\URI(self::URI_AUTHORITY_AND_FRAGMENT);
@@ -297,9 +275,8 @@ public function test_authority_and_fragment(): void
$this->assertNull($uri->getQuery());
$this->assertEquals('fragment$,;:A!\'*+()ar_1=val_1&', $uri->getFragment());
}
- /**
- * @depends test_init
- */
+
+ #[\PHPUnit\Framework\Attributes\Depends('test_init')]
public function test_authority_path_fragment(): void
{
$uri = new ILIAS\Data\URI(self::URI_AUTHORITY_PATH_FRAGMENT);
@@ -312,9 +289,7 @@ public function test_authority_path_fragment(): void
$this->assertEquals('frag:A!\'*+()arment', $uri->getFragment());
}
- /**
- * @depends test_init
- */
+ #[\PHPUnit\Framework\Attributes\Depends('test_init')]
public function test_path(): void
{
$uri = new ILIAS\Data\URI(self::URI_PATH);
@@ -328,9 +303,7 @@ public function test_path(): void
$this->assertEquals('git://git$,;hub.com:8080/someacc$,;ount/somerepo/somerepo.git', $uri->getBaseURI());
}
- /**
- * @depends test_init
- */
+ #[\PHPUnit\Framework\Attributes\Depends('test_init')]
public function test_authority_only(): void
{
$uri = new ILIAS\Data\URI(self::URI_AUTHORITY_ONLY);
@@ -344,63 +317,49 @@ public function test_authority_only(): void
$this->assertEquals('git://git$,;hub.com', $uri->getBaseURI());
}
- /**
- * @depends test_init
- */
+ #[\PHPUnit\Framework\Attributes\Depends('test_init')]
public function test_no_schema(): void
{
$this->expectException(TypeError::class);
new ILIAS\Data\URI(self::URI_NO_SCHEMA);
}
- /**
- * @depends test_init
- */
+ #[\PHPUnit\Framework\Attributes\Depends('test_init')]
public function test_no_authority(): void
{
$this->expectException(TypeError::class);
new ILIAS\Data\URI(self::URI_NO_AUTHORITY);
}
- /**
- * @depends test_init
- */
+ #[\PHPUnit\Framework\Attributes\Depends('test_init')]
public function test_wrong_char_in_schema(): void
{
$this->expectException(TypeError::class);
new ILIAS\Data\URI(self::URI_WRONG_SCHEMA);
}
- /**
- * @depends test_init
- */
+ #[\PHPUnit\Framework\Attributes\Depends('test_init')]
public function test_wrong_authority_in_schema_1(): void
{
$this->expectException(InvalidArgumentException::class);
new ILIAS\Data\URI(self::URI_WRONG_AUTHORITY_1);
}
- /**
- * @depends test_init
- */
+ #[\PHPUnit\Framework\Attributes\Depends('test_init')]
public function test_wrong_authority_in_schema_2(): void
{
$this->expectException(InvalidArgumentException::class);
new ILIAS\Data\URI(self::URI_WRONG_AUTHORITY_2);
}
- /**
- * @depends test_init
- */
+ #[\PHPUnit\Framework\Attributes\Depends('test_init')]
public function test_uri_invalid(): void
{
$this->expectException(InvalidArgumentException::class);
new ILIAS\Data\URI(self::URI_INVALID);
}
- /**
- * @depends test_init
- */
+ #[\PHPUnit\Framework\Attributes\Depends('test_init')]
public function test_realpctenc(): void
{
$uri = new ILIAS\Data\URI(self::URI_REALPCTENC);
@@ -408,63 +367,49 @@ public function test_realpctenc(): void
$this->assertEquals(self::PARAMS_REALPCTENC, $uri->getParameters());
}
- /**
- * @depends test_init
- */
+ #[\PHPUnit\Framework\Attributes\Depends('test_init')]
public function test_fakepcenc(): void
{
$this->expectException(InvalidArgumentException::class);
new ILIAS\Data\URI(self::URI_FAKEPCENC);
}
- /**
- * @depends test_init
- */
+ #[\PHPUnit\Framework\Attributes\Depends('test_init')]
public function test_alphadigit_start_host(): void
{
$this->expectException(InvalidArgumentException::class);
new ILIAS\Data\URI(self::URI_HOST_ALPHADIG_START_1);
}
- /**
- * @depends test_init
- */
+ #[\PHPUnit\Framework\Attributes\Depends('test_init')]
public function test_alphadigit_start_host_2(): void
{
$this->expectException(InvalidArgumentException::class);
new ILIAS\Data\URI(self::URI_HOST_ALPHADIG_START_2);
}
- /**
- * @depends test_init
- */
+ #[\PHPUnit\Framework\Attributes\Depends('test_init')]
public function test_alphadigit_start_host_3(): void
{
$this->expectException(InvalidArgumentException::class);
new ILIAS\Data\URI(self::URI_HOST_ALPHADIG_START_3);
}
- /**
- * @depends test_init
- */
+ #[\PHPUnit\Framework\Attributes\Depends('test_init')]
public function test_alphadigit_start_host_4(): void
{
$this->expectException(InvalidArgumentException::class);
new ILIAS\Data\URI(self::URI_HOST_ALPHADIG_START_4);
}
- /**
- * @depends test_init
- */
+ #[\PHPUnit\Framework\Attributes\Depends('test_init')]
public function test_alphadigit_start_host_5(): void
{
$this->expectException(InvalidArgumentException::class);
new ILIAS\Data\URI(self::URI_HOST_ALPHADIG_START_5);
}
- /**
- * @depends test_init
- */
+ #[\PHPUnit\Framework\Attributes\Depends('test_init')]
public function test_with_schema($uri): void
{
$this->assertEquals('g+it', $uri->getSchema());
@@ -484,9 +429,7 @@ public function test_with_schema($uri): void
$this->assertEquals('fragment', $uri->getFragment());
}
- /**
- * @depends test_with_schema
- */
+ #[\PHPUnit\Framework\Attributes\Depends('test_with_schema')]
public function test_with_schema_invalid_1(): void
{
$this->expectException(InvalidArgumentException::class);
@@ -494,9 +437,7 @@ public function test_with_schema_invalid_1(): void
$uri->withSchema('');
}
- /**
- * @depends test_with_schema
- */
+ #[\PHPUnit\Framework\Attributes\Depends('test_with_schema')]
public function test_with_schema_invalid_2(): void
{
$this->expectException(InvalidArgumentException::class);
@@ -504,9 +445,7 @@ public function test_with_schema_invalid_2(): void
$uri->withSchema('1aa');
}
- /**
- * @depends test_init
- */
+ #[\PHPUnit\Framework\Attributes\Depends('test_init')]
public function test_with_port($uri): void
{
$this->assertEquals('g+it', $uri->getSchema());
@@ -535,9 +474,7 @@ public function test_with_port($uri): void
}
- /**
- * @depends test_with_port
- */
+ #[\PHPUnit\Framework\Attributes\Depends('test_with_port')]
public function test_with_port_invalid_1(): void
{
$this->expectException(TypeError::class);
@@ -545,9 +482,7 @@ public function test_with_port_invalid_1(): void
$uri->withPort('a111');
}
- /**
- * @depends test_with_port
- */
+ #[\PHPUnit\Framework\Attributes\Depends('test_with_port')]
public function test_with_port_invalid_2(): void
{
$this->expectException(TypeError::class);
@@ -555,9 +490,7 @@ public function test_with_port_invalid_2(): void
$uri->withPort('foo');
}
- /**
- * @depends test_init
- */
+ #[\PHPUnit\Framework\Attributes\Depends('test_init')]
public function test_with_host($uri): void
{
$this->assertEquals('g+it', $uri->getSchema());
@@ -577,10 +510,7 @@ public function test_with_host($uri): void
$this->assertEquals('fragment', $uri->getFragment());
}
-
- /**
- * @depends test_with_host
- */
+ #[\PHPUnit\Framework\Attributes\Depends('test_with_host')]
public function test_with_host_invalid_1(): void
{
$this->expectException(InvalidArgumentException::class);
@@ -588,9 +518,6 @@ public function test_with_host_invalid_1(): void
$uri->withHost('-foo-.de');
}
- /**
- * @depends test_with_host
- */
public function test_with_host_invalid_3(): void
{
$this->expectException(InvalidArgumentException::class);
@@ -598,9 +525,7 @@ public function test_with_host_invalid_3(): void
$uri->withHost('');
}
- /**
- * @depends test_with_host
- */
+ #[\PHPUnit\Framework\Attributes\Depends('test_with_host')]
public function test_with_host_invalid_4(): void
{
$this->expectException(InvalidArgumentException::class);
@@ -608,9 +533,7 @@ public function test_with_host_invalid_4(): void
$uri->withHost('ilias.de">