From 0da1d1aa8d7bd983058f0d1031b53eab22a0ae3d Mon Sep 17 00:00:00 2001 From: Richard Klees Date: Fri, 19 Jan 2024 15:38:05 +0100 Subject: [PATCH] Refinery: implement in new component framework --- components/ILIAS/Refinery/Component.php | 6 +++- .../ILIAS/Refinery/src/Custom/Constraint.php | 8 ++--- .../ILIAS/Refinery/src/Custom/Group.php | 6 ++-- components/ILIAS/Refinery/src/Factory.php | 6 ++-- .../ILIAS/Refinery/src/FactoryFactory.php | 36 +++++++++++++++++++ .../Refinery/src/Integer/GreaterThan.php | 4 +-- .../src/Integer/GreaterThanOrEqual.php | 4 +-- .../ILIAS/Refinery/src/Integer/Group.php | 6 ++-- .../ILIAS/Refinery/src/Integer/LessThan.php | 4 +-- .../Refinery/src/Integer/LessThanOrEqual.php | 4 +-- components/ILIAS/Refinery/src/IsNull.php | 4 +-- .../ILIAS/Refinery/src/Logical/Group.php | 6 ++-- .../ILIAS/Refinery/src/Logical/LogicalOr.php | 6 ++-- components/ILIAS/Refinery/src/Logical/Not.php | 4 +-- .../ILIAS/Refinery/src/Logical/Parallel.php | 6 ++-- .../ILIAS/Refinery/src/Logical/Sequential.php | 6 ++-- .../ILIAS/Refinery/src/Numeric/Group.php | 6 ++-- .../ILIAS/Refinery/src/Numeric/IsNumeric.php | 4 +-- .../ILIAS/Refinery/src/Password/Group.php | 6 ++-- .../Refinery/src/Password/HasLowerChars.php | 4 +-- .../Refinery/src/Password/HasMinLength.php | 4 +-- .../Refinery/src/Password/HasNumbers.php | 4 +-- .../Refinery/src/Password/HasSpecialChars.php | 4 +-- .../Refinery/src/Password/HasUpperChars.php | 4 +-- .../ILIAS/Refinery/src/String/Group.php | 6 ++-- .../Refinery/src/String/HasMaxLength.php | 4 +-- .../Refinery/src/String/HasMinLength.php | 4 +-- .../Container/Transformation/AddLabelTest.php | 2 +- .../Transformation/MapValuesTest.php | 4 +-- .../tests/Custom/Constraint/CustomTest.php | 4 +-- .../ILIAS/Refinery/tests/Custom/GroupTest.php | 6 ++-- .../TransformationsCustomTest.php | 2 +- .../ILIAS/Refinery/tests/FactoryTest.php | 4 +-- .../Constraints/GreaterThanConstraintTest.php | 6 ++-- .../GreaterThanOrEqualConstraintTest.php | 6 ++-- .../Constraints/LessThanConstraintTest.php | 6 ++-- .../LessThanOrEqualConstraintTest.php | 6 ++-- .../Refinery/tests/Integer/GroupTest.php | 4 +-- .../Refinery/tests/KeyValueAccessTest.php | 4 +-- .../Logical/Constraint/LogicalOrTest.php | 2 +- .../Logical/Constraint/NotConstraintTest.php | 4 +-- .../Constraint/ParallelConstraintsTest.php | 4 +-- .../Constraint/SequentialConstraintTest.php | 4 +-- .../Refinery/tests/Logical/GroupTest.php | 6 ++-- .../Null/Constraint/IsNullConstraintTest.php | 4 +-- .../Refinery/tests/Numeric/GroupTest.php | 6 ++-- .../Validation/IsNumericConstraintTest.php | 4 +-- .../Constraint/PasswordContraintsTest.php | 2 +- .../Refinery/tests/Password/GroupTest.php | 6 ++-- .../HasMaxLengthConstraintTest.php | 4 +-- .../HasMinLengthConstraintTest.php | 4 +-- .../tests/String/EstimatedReadingTimeTest.php | 4 +-- .../ILIAS/Refinery/tests/String/GroupTest.php | 4 +-- .../Refinery/tests/String/LevenshteinTest.php | 4 +-- .../String/MarkdownFormattingToHTMLTest.php | 4 +-- .../Refinery/tests/String/StripTagsTest.php | 2 +- .../String/Transformation/CaseOfLabelTest.php | 2 +- .../String/Transformation/SplitStringTest.php | 2 +- .../Refinery/tests/String/UTFNormalTest.php | 4 +-- components/ILIAS/Refinery/tests/TestCase.php | 8 ++--- 60 files changed, 172 insertions(+), 132 deletions(-) create mode 100644 components/ILIAS/Refinery/src/FactoryFactory.php diff --git a/components/ILIAS/Refinery/Component.php b/components/ILIAS/Refinery/Component.php index cc57e21c653d..5bc27baeff38 100644 --- a/components/ILIAS/Refinery/Component.php +++ b/components/ILIAS/Refinery/Component.php @@ -32,6 +32,10 @@ public function init( array | \ArrayAccess &$pull, array | \ArrayAccess &$internal, ): void { - // ... + $provide[\ILIAS\Refinery\Factory::class] = fn() => + new \ILIAS\Refinery\Factory( + $pull[\ILIAS\Data\Factory::class], + $use[\ILIAS\Language\Language::class] + ); } } diff --git a/components/ILIAS/Refinery/src/Custom/Constraint.php b/components/ILIAS/Refinery/src/Custom/Constraint.php index 1a9a5a7e59f7..67a1e9d691e8 100755 --- a/components/ILIAS/Refinery/src/Custom/Constraint.php +++ b/components/ILIAS/Refinery/src/Custom/Constraint.php @@ -26,7 +26,7 @@ use ILIAS\Data; use ILIAS\Data\Result; use ILIAS\Refinery\ProblemBuilder; -use ilLanguage; +use ILIAS\Language\Language; class Constraint implements ConstraintInterface { @@ -35,7 +35,7 @@ class Constraint implements ConstraintInterface use ProblemBuilder; protected Data\Factory $data_factory; - protected ilLanguage $lng; + protected \ILIAS\Language\Language $lng; /** @var callable */ protected $is_ok; /** @var callable|string */ @@ -51,9 +51,9 @@ class Constraint implements ConstraintInterface * @param callable $is_ok * @param string|callable $error * @param Data\Factory $data_factory - * @param ilLanguage $lng + * @param \ILIAS\Language\Language $lng */ - public function __construct(callable $is_ok, $error, Data\Factory $data_factory, ilLanguage $lng) + public function __construct(callable $is_ok, $error, Data\Factory $data_factory, \ILIAS\Language\Language $lng) { $this->is_ok = $is_ok; $this->error = $error; diff --git a/components/ILIAS/Refinery/src/Custom/Group.php b/components/ILIAS/Refinery/src/Custom/Group.php index c4bd31f3b465..5777e22271ed 100755 --- a/components/ILIAS/Refinery/src/Custom/Group.php +++ b/components/ILIAS/Refinery/src/Custom/Group.php @@ -21,16 +21,16 @@ namespace ILIAS\Refinery\Custom; use ILIAS\Data\Factory; -use ilLanguage; +use ILIAS\Language\Language; use ILIAS\Refinery\Constraint as ConstraintInterface; use ILIAS\Refinery\Transformation as TransformationInterface; class Group { private Factory $dataFactory; - private ilLanguage $language; + private \ILIAS\Language\Language $language; - public function __construct(Factory $dataFactory, ilLanguage $language) + public function __construct(Factory $dataFactory, \ILIAS\Language\Language $language) { $this->dataFactory = $dataFactory; $this->language = $language; diff --git a/components/ILIAS/Refinery/src/Factory.php b/components/ILIAS/Refinery/src/Factory.php index 0b39f450cd62..4cb9c9f3064b 100755 --- a/components/ILIAS/Refinery/src/Factory.php +++ b/components/ILIAS/Refinery/src/Factory.php @@ -23,14 +23,14 @@ use ILIAS\Refinery\In; use ILIAS\Refinery\To; use ILIAS\Refinery\Random\Group as RandomGroup; -use ilLanguage; +use ILIAS\Language\Language; class Factory { private \ILIAS\Data\Factory $dataFactory; - private ilLanguage $language; + private \ILIAS\Language\Language $language; - public function __construct(\ILIAS\Data\Factory $dataFactory, ilLanguage $language) + public function __construct(\ILIAS\Data\Factory $dataFactory, \ILIAS\Language\Language $language) { $this->dataFactory = $dataFactory; $this->language = $language; diff --git a/components/ILIAS/Refinery/src/FactoryFactory.php b/components/ILIAS/Refinery/src/FactoryFactory.php new file mode 100644 index 000000000000..3d181d4bbbbe --- /dev/null +++ b/components/ILIAS/Refinery/src/FactoryFactory.php @@ -0,0 +1,36 @@ +dataFactory = $dataFactory; $this->language = $language; diff --git a/components/ILIAS/Refinery/src/Integer/LessThan.php b/components/ILIAS/Refinery/src/Integer/LessThan.php index 1842f2883bf8..065f0e6d8024 100755 --- a/components/ILIAS/Refinery/src/Integer/LessThan.php +++ b/components/ILIAS/Refinery/src/Integer/LessThan.php @@ -22,11 +22,11 @@ use ILIAS\Data; use ILIAS\Refinery\Custom\Constraint; -use ilLanguage; +use ILIAS\Language\Language; class LessThan extends Constraint { - public function __construct(int $max, Data\Factory $data_factory, ilLanguage $lng) + public function __construct(int $max, Data\Factory $data_factory, \ILIAS\Language\Language $lng) { parent::__construct( static function ($value) use ($max): bool { diff --git a/components/ILIAS/Refinery/src/Integer/LessThanOrEqual.php b/components/ILIAS/Refinery/src/Integer/LessThanOrEqual.php index 7b3c23197b62..241a3ab8f2c6 100755 --- a/components/ILIAS/Refinery/src/Integer/LessThanOrEqual.php +++ b/components/ILIAS/Refinery/src/Integer/LessThanOrEqual.php @@ -22,11 +22,11 @@ use ILIAS\Data; use ILIAS\Refinery\Custom\Constraint; -use ilLanguage; +use ILIAS\Language\Language; class LessThanOrEqual extends Constraint { - public function __construct(int $max, Data\Factory $data_factory, ilLanguage $lng) + public function __construct(int $max, Data\Factory $data_factory, \ILIAS\Language\Language $lng) { parent::__construct( static function ($value) use ($max): bool { diff --git a/components/ILIAS/Refinery/src/IsNull.php b/components/ILIAS/Refinery/src/IsNull.php index a0a64c17dcac..2fcfa46951bf 100755 --- a/components/ILIAS/Refinery/src/IsNull.php +++ b/components/ILIAS/Refinery/src/IsNull.php @@ -22,11 +22,11 @@ use ILIAS\Refinery\Custom\Constraint; use ILIAS\Data; -use ilLanguage; +use ILIAS\Language\Language; class IsNull extends Constraint { - public function __construct(Data\Factory $data_factory, ilLanguage $lng) + public function __construct(Data\Factory $data_factory, \ILIAS\Language\Language $lng) { parent::__construct( static function ($value): bool { diff --git a/components/ILIAS/Refinery/src/Logical/Group.php b/components/ILIAS/Refinery/src/Logical/Group.php index 8076fc03f09b..ce29c7a65581 100755 --- a/components/ILIAS/Refinery/src/Logical/Group.php +++ b/components/ILIAS/Refinery/src/Logical/Group.php @@ -23,14 +23,14 @@ use ILIAS\Data\Factory; use ILIAS\Refinery\Custom\Constraint; use ILIAS\Refinery\Constraint as ConstraintInterface; -use ilLanguage; +use ILIAS\Language\Language; class Group { private Factory $dataFactory; - private ilLanguage $language; + private \ILIAS\Language\Language $language; - public function __construct(Factory $dataFactory, ilLanguage $language) + public function __construct(Factory $dataFactory, \ILIAS\Language\Language $language) { $this->dataFactory = $dataFactory; $this->language = $language; diff --git a/components/ILIAS/Refinery/src/Logical/LogicalOr.php b/components/ILIAS/Refinery/src/Logical/LogicalOr.php index 2043b060e449..c372bdb38011 100755 --- a/components/ILIAS/Refinery/src/Logical/LogicalOr.php +++ b/components/ILIAS/Refinery/src/Logical/LogicalOr.php @@ -22,7 +22,7 @@ use ILIAS\Refinery\Custom\Constraint; use ILIAS\Data; -use ilLanguage; +use ILIAS\Language\Language; class LogicalOr extends Constraint { @@ -30,9 +30,9 @@ class LogicalOr extends Constraint * LogicalOr constructor. * @param Constraint[] $other * @param Data\Factory $data_factory - * @param ilLanguage $lng + * @param \ILIAS\Language\Language $lng */ - public function __construct(array $other, Data\Factory $data_factory, ilLanguage $lng) + public function __construct(array $other, Data\Factory $data_factory, \ILIAS\Language\Language $lng) { parent::__construct( static function ($value) use ($other): bool { diff --git a/components/ILIAS/Refinery/src/Logical/Not.php b/components/ILIAS/Refinery/src/Logical/Not.php index 35ae5387e544..916656ee5261 100755 --- a/components/ILIAS/Refinery/src/Logical/Not.php +++ b/components/ILIAS/Refinery/src/Logical/Not.php @@ -22,11 +22,11 @@ use ILIAS\Refinery\Custom\Constraint; use ILIAS\Data; -use ilLanguage; +use ILIAS\Language\Language; class Not extends Constraint { - public function __construct(Constraint $constraint, Data\Factory $data_factory, ilLanguage $lng) + public function __construct(Constraint $constraint, Data\Factory $data_factory, \ILIAS\Language\Language $lng) { parent::__construct( static function ($value) use ($constraint) { diff --git a/components/ILIAS/Refinery/src/Logical/Parallel.php b/components/ILIAS/Refinery/src/Logical/Parallel.php index 9264d4643d49..def5c001e71a 100755 --- a/components/ILIAS/Refinery/src/Logical/Parallel.php +++ b/components/ILIAS/Refinery/src/Logical/Parallel.php @@ -22,7 +22,7 @@ use ILIAS\Refinery\Custom\Constraint; use ILIAS\Data; -use ilLanguage; +use ILIAS\Language\Language; class Parallel extends Constraint { @@ -37,9 +37,9 @@ class Parallel extends Constraint /** * @param Constraint[] $constraints * @param Data\Factory $data_factory - * @param ilLanguage $lng + * @param \ILIAS\Language\Language $lng */ - public function __construct(array $constraints, Data\Factory $data_factory, ilLanguage $lng) + public function __construct(array $constraints, Data\Factory $data_factory, \ILIAS\Language\Language $lng) { parent::__construct( function ($value) use ($constraints): bool { diff --git a/components/ILIAS/Refinery/src/Logical/Sequential.php b/components/ILIAS/Refinery/src/Logical/Sequential.php index 75c0ee79d2bc..51cfacdeea51 100755 --- a/components/ILIAS/Refinery/src/Logical/Sequential.php +++ b/components/ILIAS/Refinery/src/Logical/Sequential.php @@ -23,7 +23,7 @@ use ILIAS\Refinery\Custom\Constraint as CustomConstraint; use ILIAS\Refinery\Constraint; use ILIAS\Data; -use ilLanguage; +use ILIAS\Language\Language; class Sequential extends CustomConstraint { @@ -38,9 +38,9 @@ class Sequential extends CustomConstraint /** * @param Constraint[] $constraints * @param Data\Factory $data_factory - * @param ilLanguage $lng + * @param \ILIAS\Language\Language $lng */ - public function __construct(array $constraints, Data\Factory $data_factory, ilLanguage $lng) + public function __construct(array $constraints, Data\Factory $data_factory, \ILIAS\Language\Language $lng) { parent::__construct( function ($value) use ($constraints): bool { diff --git a/components/ILIAS/Refinery/src/Numeric/Group.php b/components/ILIAS/Refinery/src/Numeric/Group.php index 5c9e00d0307b..0e56689ac03f 100755 --- a/components/ILIAS/Refinery/src/Numeric/Group.php +++ b/components/ILIAS/Refinery/src/Numeric/Group.php @@ -22,14 +22,14 @@ use ILIAS\Data\Factory; use ILIAS\Refinery\Constraint; -use ilLanguage; +use ILIAS\Language\Language; class Group { private Factory $dataFactory; - private ilLanguage $language; + private \ILIAS\Language\Language $language; - public function __construct(Factory $dataFactory, ilLanguage $language) + public function __construct(Factory $dataFactory, \ILIAS\Language\Language $language) { $this->dataFactory = $dataFactory; $this->language = $language; diff --git a/components/ILIAS/Refinery/src/Numeric/IsNumeric.php b/components/ILIAS/Refinery/src/Numeric/IsNumeric.php index 1ddef031c260..9442fd5f6c9b 100755 --- a/components/ILIAS/Refinery/src/Numeric/IsNumeric.php +++ b/components/ILIAS/Refinery/src/Numeric/IsNumeric.php @@ -22,11 +22,11 @@ use ILIAS\Refinery\Custom\Constraint; use ILIAS\Data; -use ilLanguage; +use ILIAS\Language\Language; class IsNumeric extends Constraint { - public function __construct(Data\Factory $data_factory, ilLanguage $lng) + public function __construct(Data\Factory $data_factory, \ILIAS\Language\Language $lng) { parent::__construct( static function ($value): bool { diff --git a/components/ILIAS/Refinery/src/Password/Group.php b/components/ILIAS/Refinery/src/Password/Group.php index 5261e581a2f0..936fb53cbf9f 100755 --- a/components/ILIAS/Refinery/src/Password/Group.php +++ b/components/ILIAS/Refinery/src/Password/Group.php @@ -22,14 +22,14 @@ use ILIAS\Data\Factory; use ILIAS\Refinery\Constraint; -use ilLanguage; +use ILIAS\Language\Language; class Group { protected Factory $data_factory; - protected ilLanguage $lng; + protected \ILIAS\Language\Language $lng; - public function __construct(Factory $data_factory, ilLanguage $lng) + public function __construct(Factory $data_factory, \ILIAS\Language\Language $lng) { $this->data_factory = $data_factory; $this->lng = $lng; diff --git a/components/ILIAS/Refinery/src/Password/HasLowerChars.php b/components/ILIAS/Refinery/src/Password/HasLowerChars.php index 20b8e9ab8316..bb28ee2c3021 100755 --- a/components/ILIAS/Refinery/src/Password/HasLowerChars.php +++ b/components/ILIAS/Refinery/src/Password/HasLowerChars.php @@ -22,11 +22,11 @@ use ILIAS\Refinery\Custom\Constraint; use ILIAS\Data; -use ilLanguage; +use ILIAS\Language\Language; class HasLowerChars extends Constraint { - public function __construct(Data\Factory $data_factory, ilLanguage $lng) + public function __construct(Data\Factory $data_factory, \ILIAS\Language\Language $lng) { parent::__construct( static function (Data\Password $value): bool { diff --git a/components/ILIAS/Refinery/src/Password/HasMinLength.php b/components/ILIAS/Refinery/src/Password/HasMinLength.php index a4fce65213a8..f8329375e63a 100755 --- a/components/ILIAS/Refinery/src/Password/HasMinLength.php +++ b/components/ILIAS/Refinery/src/Password/HasMinLength.php @@ -22,11 +22,11 @@ use ILIAS\Refinery\Custom\Constraint; use ILIAS\Data; -use ilLanguage; +use ILIAS\Language\Language; class HasMinLength extends Constraint { - public function __construct(int $min_length, Data\Factory $data_factory, ilLanguage $lng) + public function __construct(int $min_length, Data\Factory $data_factory, \ILIAS\Language\Language $lng) { parent::__construct( static function (Data\Password $value) use ($min_length): bool { diff --git a/components/ILIAS/Refinery/src/Password/HasNumbers.php b/components/ILIAS/Refinery/src/Password/HasNumbers.php index aff8a0ba91ee..3e0d8f044885 100755 --- a/components/ILIAS/Refinery/src/Password/HasNumbers.php +++ b/components/ILIAS/Refinery/src/Password/HasNumbers.php @@ -22,11 +22,11 @@ use ILIAS\Refinery\Custom\Constraint; use ILIAS\Data; -use ilLanguage; +use ILIAS\Language\Language; class HasNumbers extends Constraint { - public function __construct(Data\Factory $data_factory, ilLanguage $lng) + public function __construct(Data\Factory $data_factory, \ILIAS\Language\Language $lng) { parent::__construct( static function (Data\Password $value): bool { diff --git a/components/ILIAS/Refinery/src/Password/HasSpecialChars.php b/components/ILIAS/Refinery/src/Password/HasSpecialChars.php index c938e8aea19d..f2623353f42f 100755 --- a/components/ILIAS/Refinery/src/Password/HasSpecialChars.php +++ b/components/ILIAS/Refinery/src/Password/HasSpecialChars.php @@ -22,13 +22,13 @@ use ILIAS\Refinery\Custom\Constraint; use ILIAS\Data; -use ilLanguage; +use ILIAS\Language\Language; class HasSpecialChars extends Constraint { private const ALLOWED_CHARS = '/[,_.\-#\+\*?!%ยง\(\)\$]/u'; - public function __construct(Data\Factory $data_factory, ilLanguage $lng) + public function __construct(Data\Factory $data_factory, \ILIAS\Language\Language $lng) { parent::__construct( static function (Data\Password $value): bool { diff --git a/components/ILIAS/Refinery/src/Password/HasUpperChars.php b/components/ILIAS/Refinery/src/Password/HasUpperChars.php index 7147f70e09c6..48b746ed2d84 100755 --- a/components/ILIAS/Refinery/src/Password/HasUpperChars.php +++ b/components/ILIAS/Refinery/src/Password/HasUpperChars.php @@ -22,11 +22,11 @@ use ILIAS\Refinery\Custom\Constraint; use ILIAS\Data; -use ilLanguage; +use ILIAS\Language\Language; class HasUpperChars extends Constraint { - public function __construct(Data\Factory $data_factory, ilLanguage $lng) + public function __construct(Data\Factory $data_factory, \ILIAS\Language\Language $lng) { parent::__construct( static function (Data\Password $value): bool { diff --git a/components/ILIAS/Refinery/src/String/Group.php b/components/ILIAS/Refinery/src/String/Group.php index a32cff10cda3..d24efe9de0f2 100755 --- a/components/ILIAS/Refinery/src/String/Group.php +++ b/components/ILIAS/Refinery/src/String/Group.php @@ -21,16 +21,16 @@ namespace ILIAS\Refinery\String; use ILIAS\Data\Factory; -use ilLanguage; +use ILIAS\Language\Language; use ILIAS\Refinery\Constraint; use ILIAS\Refinery\Transformation; class Group { private Factory $dataFactory; - private ilLanguage $language; + private \ILIAS\Language\Language $language; - public function __construct(Factory $dataFactory, ilLanguage $language) + public function __construct(Factory $dataFactory, \ILIAS\Language\Language $language) { $this->dataFactory = $dataFactory; $this->language = $language; diff --git a/components/ILIAS/Refinery/src/String/HasMaxLength.php b/components/ILIAS/Refinery/src/String/HasMaxLength.php index 2f22174adf19..3c535a818ccb 100755 --- a/components/ILIAS/Refinery/src/String/HasMaxLength.php +++ b/components/ILIAS/Refinery/src/String/HasMaxLength.php @@ -22,11 +22,11 @@ use ILIAS\Data; use ILIAS\Refinery\Custom\Constraint; -use ilLanguage; +use ILIAS\Language\Language; class HasMaxLength extends Constraint { - public function __construct(int $max_length, Data\Factory $data_factory, ilLanguage $lng) + public function __construct(int $max_length, Data\Factory $data_factory, \ILIAS\Language\Language $lng) { parent::__construct( static function ($value) use ($max_length): bool { diff --git a/components/ILIAS/Refinery/src/String/HasMinLength.php b/components/ILIAS/Refinery/src/String/HasMinLength.php index 275a658832d6..246653b32336 100755 --- a/components/ILIAS/Refinery/src/String/HasMinLength.php +++ b/components/ILIAS/Refinery/src/String/HasMinLength.php @@ -22,11 +22,11 @@ use ILIAS\Data; use ILIAS\Refinery\Custom\Constraint; -use ilLanguage; +use ILIAS\Language\Language; class HasMinLength extends Constraint { - public function __construct(int $min_length, Data\Factory $data_factory, ilLanguage $lng) + public function __construct(int $min_length, Data\Factory $data_factory, \ILIAS\Language\Language $lng) { parent::__construct( static function ($value) use ($min_length): bool { diff --git a/components/ILIAS/Refinery/tests/Container/Transformation/AddLabelTest.php b/components/ILIAS/Refinery/tests/Container/Transformation/AddLabelTest.php index e9c768c64fa9..7e90de298dc6 100755 --- a/components/ILIAS/Refinery/tests/Container/Transformation/AddLabelTest.php +++ b/components/ILIAS/Refinery/tests/Container/Transformation/AddLabelTest.php @@ -38,7 +38,7 @@ class AddLabelTest extends TestCase protected function setUp(): void { $dataFactory = new DataFactory(); - $language = $this->createMock(ilLanguage::class); + $language = $this->createMock(ILIAS\Language\Language::class); $this->f = new Refinery($dataFactory, $language); $this->add_label = $this->f->container()->addLabels(self::$labels); diff --git a/components/ILIAS/Refinery/tests/Container/Transformation/MapValuesTest.php b/components/ILIAS/Refinery/tests/Container/Transformation/MapValuesTest.php index 317628f99d2a..d5e4f1cb7403 100755 --- a/components/ILIAS/Refinery/tests/Container/Transformation/MapValuesTest.php +++ b/components/ILIAS/Refinery/tests/Container/Transformation/MapValuesTest.php @@ -43,10 +43,10 @@ class MapValuesTest extends TestCase protected function setUp(): void { $dataFactory = new DataFactory(); - $language = $this->createMock(ilLanguage::class); + $language = $this->createMock(ILIAS\Language\Language::class); $this->f = new Refinery($dataFactory, $language); - $this->map_values = $this->f->container()->mapValues($this->f->custom()->transformation(fn ($v) => $v * 2)); + $this->map_values = $this->f->container()->mapValues($this->f->custom()->transformation(fn($v) => $v * 2)); } public function testTransform(): void diff --git a/components/ILIAS/Refinery/tests/Custom/Constraint/CustomTest.php b/components/ILIAS/Refinery/tests/Custom/Constraint/CustomTest.php index b3f7e3f23d97..e510b26a3b6f 100755 --- a/components/ILIAS/Refinery/tests/Custom/Constraint/CustomTest.php +++ b/components/ILIAS/Refinery/tests/Custom/Constraint/CustomTest.php @@ -25,7 +25,7 @@ class CustomTest extends TestCase { private string $txt_id = ''; - private ilLanguage $lng; + private ILIAS\Language\Language $lng; private CustomConstraint $constraint; protected function setUp(): void @@ -37,7 +37,7 @@ protected function setUp(): void $error = function (callable $txt, $value): string { return $txt($this->txt_id, $value); }; - $this->lng = $this->createMock(ilLanguage::class); + $this->lng = $this->createMock(ILIAS\Language\Language::class); $this->constraint = new class ($is_ok, $error, new DataFactory(), $this->lng) extends CustomConstraint { public function _getLngClosure(): Closure { diff --git a/components/ILIAS/Refinery/tests/Custom/GroupTest.php b/components/ILIAS/Refinery/tests/Custom/GroupTest.php index 9b1248fa383c..0d726d10d28b 100755 --- a/components/ILIAS/Refinery/tests/Custom/GroupTest.php +++ b/components/ILIAS/Refinery/tests/Custom/GroupTest.php @@ -25,18 +25,18 @@ use ILIAS\Refinery\Custom\Transformation as CustomTransformation; use ILIAS\Refinery\Custom\Constraint as CustomConstraint; use PHPUnit\Framework\TestCase; -use ilLanguage; +use ILIAS\Language\Language; class GroupTest extends TestCase { private CustomGroup $group; private DataFactory $dataFactory; - private ilLanguage $language; + private ILIAS\Language\Language $language; protected function setUp(): void { $this->dataFactory = new DataFactory(); - $this->language = $this->getMockBuilder(ilLanguage::class) + $this->language = $this->getMockBuilder(ILIAS\Language\Language::class) ->disableOriginalConstructor() ->getMock(); diff --git a/components/ILIAS/Refinery/tests/Custom/Transformation/TransformationsCustomTest.php b/components/ILIAS/Refinery/tests/Custom/Transformation/TransformationsCustomTest.php index 1269d3b8bd64..fbddf4400be6 100755 --- a/components/ILIAS/Refinery/tests/Custom/Transformation/TransformationsCustomTest.php +++ b/components/ILIAS/Refinery/tests/Custom/Transformation/TransformationsCustomTest.php @@ -32,7 +32,7 @@ class TransformationsCustomTest extends TestCase protected function setUp(): void { - $language = $this->createMock(ilLanguage::class); + $language = $this->createMock(ILIAS\Language\Language::class); $this->f = new Refinery(new DataFactory(), $language); $this->custom = $this->f->custom()->transformation( diff --git a/components/ILIAS/Refinery/tests/FactoryTest.php b/components/ILIAS/Refinery/tests/FactoryTest.php index 0ae693486daf..d0af8496e781 100755 --- a/components/ILIAS/Refinery/tests/FactoryTest.php +++ b/components/ILIAS/Refinery/tests/FactoryTest.php @@ -35,7 +35,7 @@ use ILIAS\Refinery\String\Group as StringGroup; use ILIAS\Refinery\To\Group as ToGroup; use ILIAS\Refinery\URI\Group as URIGroup; -use ilLanguage; +use ILIAS\Language\Language; use PHPUnit\Framework\TestCase; class FactoryTest extends TestCase @@ -44,7 +44,7 @@ class FactoryTest extends TestCase protected function setUp(): void { - $language = $this->getMockBuilder(ilLanguage::class) + $language = $this->getMockBuilder(ILIAS\Language\Language::class) ->disableOriginalConstructor() ->getMock(); diff --git a/components/ILIAS/Refinery/tests/Integer/Constraints/GreaterThanConstraintTest.php b/components/ILIAS/Refinery/tests/Integer/Constraints/GreaterThanConstraintTest.php index f543f96a4207..223d56d51f9f 100755 --- a/components/ILIAS/Refinery/tests/Integer/Constraints/GreaterThanConstraintTest.php +++ b/components/ILIAS/Refinery/tests/Integer/Constraints/GreaterThanConstraintTest.php @@ -24,19 +24,19 @@ use ILIAS\Refinery\Constraint; use ILIAS\Refinery\Integer\GreaterThan; use PHPUnit\Framework\TestCase; -use ilLanguage; +use ILIAS\Language\Language; class GreaterThanConstraintTest extends TestCase { private DataFactory $df; - private ilLanguage $lng; + private ILIAS\Language\Language $lng; private int $greater_than; private Constraint $c; protected function setUp(): void { $this->df = new DataFactory(); - $this->lng = $this->getMockBuilder(ilLanguage::class) + $this->lng = $this->getMockBuilder(ILIAS\Language\Language::class) ->disableOriginalConstructor() ->getMock(); diff --git a/components/ILIAS/Refinery/tests/Integer/Constraints/GreaterThanOrEqualConstraintTest.php b/components/ILIAS/Refinery/tests/Integer/Constraints/GreaterThanOrEqualConstraintTest.php index 49c3b9c6fc83..f7dca0576c69 100755 --- a/components/ILIAS/Refinery/tests/Integer/Constraints/GreaterThanOrEqualConstraintTest.php +++ b/components/ILIAS/Refinery/tests/Integer/Constraints/GreaterThanOrEqualConstraintTest.php @@ -25,18 +25,18 @@ use PHPUnit\Framework\TestCase; use UnexpectedValueException; use ILIAS\Refinery\Integer\GreaterThanOrEqual; -use ilLanguage; +use ILIAS\Language\Language; class GreaterThanOrEqualConstraintTest extends TestCase { private DataFactory $df; - private ilLanguage $lng; + private ILIAS\Language\Language $lng; private Constraint $c; protected function setUp(): void { $this->df = new DataFactory(); - $this->lng = $this->getMockBuilder(ilLanguage::class) + $this->lng = $this->getMockBuilder(ILIAS\Language\Language::class) ->disableOriginalConstructor() ->getMock(); diff --git a/components/ILIAS/Refinery/tests/Integer/Constraints/LessThanConstraintTest.php b/components/ILIAS/Refinery/tests/Integer/Constraints/LessThanConstraintTest.php index fdeb8cb9418c..e9dbd1245fc9 100755 --- a/components/ILIAS/Refinery/tests/Integer/Constraints/LessThanConstraintTest.php +++ b/components/ILIAS/Refinery/tests/Integer/Constraints/LessThanConstraintTest.php @@ -23,21 +23,21 @@ use ILIAS\Data\Factory as DataFactory; use ILIAS\Refinery\Constraint; use ILIAS\Refinery\Integer\LessThan; -use ilLanguage; +use ILIAS\Language\Language; use PHPUnit\Framework\TestCase; use UnexpectedValueException; class LessThanConstraintTest extends TestCase { private Constraint $c; - private ilLanguage $lng; + private ILIAS\Language\Language $lng; private DataFactory $df; private int $less_than; protected function setUp(): void { $this->df = new DataFactory(); - $this->lng = $this->getMockBuilder(ilLanguage::class) + $this->lng = $this->getMockBuilder(ILIAS\Language\Language::class) ->disableOriginalConstructor() ->getMock(); diff --git a/components/ILIAS/Refinery/tests/Integer/Constraints/LessThanOrEqualConstraintTest.php b/components/ILIAS/Refinery/tests/Integer/Constraints/LessThanOrEqualConstraintTest.php index 154a29959563..a45603577cb9 100755 --- a/components/ILIAS/Refinery/tests/Integer/Constraints/LessThanOrEqualConstraintTest.php +++ b/components/ILIAS/Refinery/tests/Integer/Constraints/LessThanOrEqualConstraintTest.php @@ -25,18 +25,18 @@ use PHPUnit\Framework\TestCase; use UnexpectedValueException; use ILIAS\Refinery\Integer\LessThanOrEqual; -use ilLanguage; +use ILIAS\Language\Language; class LessThanOrEqualConstraintTest extends TestCase { private DataFactory $df; - private ilLanguage $lng; + private ILIAS\Language\Language $lng; private Constraint $c; protected function setUp(): void { $this->df = new DataFactory(); - $this->lng = $this->getMockBuilder(ilLanguage::class) + $this->lng = $this->getMockBuilder(ILIAS\Language\Language::class) ->disableOriginalConstructor() ->getMock(); diff --git a/components/ILIAS/Refinery/tests/Integer/GroupTest.php b/components/ILIAS/Refinery/tests/Integer/GroupTest.php index 86d40d8275e6..381a0a05e699 100755 --- a/components/ILIAS/Refinery/tests/Integer/GroupTest.php +++ b/components/ILIAS/Refinery/tests/Integer/GroupTest.php @@ -27,7 +27,7 @@ use PHPUnit\Framework\TestCase; use ILIAS\Refinery\Integer\GreaterThanOrEqual; use ILIAS\Refinery\Integer\LessThanOrEqual; -use ilLanguage; +use ILIAS\Language\Language; class GroupTest extends TestCase { @@ -36,7 +36,7 @@ class GroupTest extends TestCase protected function setUp(): void { $dataFactory = new Factory(); - $language = $this->getMockBuilder(ilLanguage::class) + $language = $this->getMockBuilder(ILIAS\Language\Language::class) ->disableOriginalConstructor() ->getMock(); diff --git a/components/ILIAS/Refinery/tests/KeyValueAccessTest.php b/components/ILIAS/Refinery/tests/KeyValueAccessTest.php index e37c906b577b..413145c67073 100755 --- a/components/ILIAS/Refinery/tests/KeyValueAccessTest.php +++ b/components/ILIAS/Refinery/tests/KeyValueAccessTest.php @@ -22,7 +22,7 @@ use ILIAS\Refinery\KeyValueAccess; use ILIAS\Refinery\Factory as Refinery; -use ilLanguage; +use ILIAS\Language\Language; use PHPUnit\Framework\TestCase as PHPUnitTestCase; use ILIAS\Data\Factory as DataFactory; @@ -32,7 +32,7 @@ class KeyValueAccessTest extends PHPUnitTestCase protected function setUp(): void { - $this->refinery = new Refinery(new DataFactory(), $this->createMock(ilLanguage::class)); + $this->refinery = new Refinery(new DataFactory(), $this->createMock(ILIAS\Language\Language::class)); } public function testAccess(): void diff --git a/components/ILIAS/Refinery/tests/Logical/Constraint/LogicalOrTest.php b/components/ILIAS/Refinery/tests/Logical/Constraint/LogicalOrTest.php index c7058ec4cc0c..42014c9fd87d 100755 --- a/components/ILIAS/Refinery/tests/Logical/Constraint/LogicalOrTest.php +++ b/components/ILIAS/Refinery/tests/Logical/Constraint/LogicalOrTest.php @@ -119,7 +119,7 @@ public function testWithProblemBuilder(LogicalOr $constraint, $okValue, $errorVa */ public function constraintsProvider(): array { - $mock = $this->getMockBuilder(ilLanguage::class)->disableOriginalConstructor()->getMock(); + $mock = $this->getMockBuilder(ILIAS\Language\Language::class)->disableOriginalConstructor()->getMock(); $data_factory = new DataFactory(); $refinery = new Refinery($data_factory, $mock); diff --git a/components/ILIAS/Refinery/tests/Logical/Constraint/NotConstraintTest.php b/components/ILIAS/Refinery/tests/Logical/Constraint/NotConstraintTest.php index d205fcd9469a..40d1405f85c2 100755 --- a/components/ILIAS/Refinery/tests/Logical/Constraint/NotConstraintTest.php +++ b/components/ILIAS/Refinery/tests/Logical/Constraint/NotConstraintTest.php @@ -26,7 +26,7 @@ class NotTest extends TestCase { private DataFactory $df; - private ilLanguage $lng; + private ILIAS\Language\Language $lng; private Refinery $refinery; private Constraint $not_true; private Constraint $not_false; @@ -34,7 +34,7 @@ class NotTest extends TestCase protected function setUp(): void { $this->df = new DataFactory(); - $this->lng = $this->createMock(ilLanguage::class); + $this->lng = $this->createMock(ILIAS\Language\Language::class); $this->refinery = new Refinery($this->df, $this->lng); $group = $this->refinery->custom(); diff --git a/components/ILIAS/Refinery/tests/Logical/Constraint/ParallelConstraintsTest.php b/components/ILIAS/Refinery/tests/Logical/Constraint/ParallelConstraintsTest.php index be6ac2630f87..6dc58f6fca89 100755 --- a/components/ILIAS/Refinery/tests/Logical/Constraint/ParallelConstraintsTest.php +++ b/components/ILIAS/Refinery/tests/Logical/Constraint/ParallelConstraintsTest.php @@ -26,14 +26,14 @@ class ParallelTest extends TestCase { private DataFactory $df; - private ilLanguage $lng; + private ILIAS\Language\Language $lng; private Constraint $c; private Refinery $refinery; protected function setUp(): void { $this->df = new DataFactory(); - $this->lng = $this->createMock(ilLanguage::class); + $this->lng = $this->createMock(ILIAS\Language\Language::class); $this->refinery = new Refinery($this->df, $this->lng); $group = $this->refinery->custom(); diff --git a/components/ILIAS/Refinery/tests/Logical/Constraint/SequentialConstraintTest.php b/components/ILIAS/Refinery/tests/Logical/Constraint/SequentialConstraintTest.php index 1906f3f8e975..c95af9bc943f 100755 --- a/components/ILIAS/Refinery/tests/Logical/Constraint/SequentialConstraintTest.php +++ b/components/ILIAS/Refinery/tests/Logical/Constraint/SequentialConstraintTest.php @@ -26,14 +26,14 @@ class SequentialTest extends TestCase { private DataFactory $df; - private ilLanguage $lng; + private ILIAS\Language\Language $lng; private Refinery $refinery; private Constraint $c; protected function setUp(): void { $this->df = new DataFactory(); - $this->lng = $this->createMock(ilLanguage::class); + $this->lng = $this->createMock(ILIAS\Language\Language::class); $this->refinery = new Refinery($this->df, $this->lng); $group = $this->refinery->custom(); diff --git a/components/ILIAS/Refinery/tests/Logical/GroupTest.php b/components/ILIAS/Refinery/tests/Logical/GroupTest.php index f4c12ae3e2ab..f1bd218bf69e 100755 --- a/components/ILIAS/Refinery/tests/Logical/GroupTest.php +++ b/components/ILIAS/Refinery/tests/Logical/GroupTest.php @@ -30,20 +30,20 @@ use ILIAS\Refinery\Logical\Sequential; use ILIAS\Refinery\Logical\Group as LogicalGroup; use PHPUnit\Framework\TestCase; -use ilLanguage; +use ILIAS\Language\Language; class GroupTest extends TestCase { private LogicalGroup $group; private DataFactory $dataFactory; - private ilLanguage $language; + private ILIAS\Language\Language $language; private Constraint $greaterThanConstraint; private Constraint $lessThanConstaint; protected function setUp(): void { $this->dataFactory = new DataFactory(); - $this->language = $this->getMockBuilder(ilLanguage::class) + $this->language = $this->getMockBuilder(ILIAS\Language\Language::class) ->disableOriginalConstructor() ->getMock(); diff --git a/components/ILIAS/Refinery/tests/Null/Constraint/IsNullConstraintTest.php b/components/ILIAS/Refinery/tests/Null/Constraint/IsNullConstraintTest.php index 76a83cc2fb0e..a53d11475654 100755 --- a/components/ILIAS/Refinery/tests/Null/Constraint/IsNullConstraintTest.php +++ b/components/ILIAS/Refinery/tests/Null/Constraint/IsNullConstraintTest.php @@ -25,14 +25,14 @@ class IsNullConstraintTest extends TestCase { private DataFactory $df; - private ilLanguage $lng; + private ILIAS\Language\Language $lng; private Refinery $f; private \ILIAS\Refinery\Constraint $c; protected function setUp(): void { $this->df = new DataFactory(); - $this->lng = $this->createMock(ilLanguage::class); + $this->lng = $this->createMock(ILIAS\Language\Language::class); $this->f = new Refinery($this->df, $this->lng); $this->c = $this->f->null(); diff --git a/components/ILIAS/Refinery/tests/Numeric/GroupTest.php b/components/ILIAS/Refinery/tests/Numeric/GroupTest.php index 76d23c55bd9a..1e2ab5719d95 100755 --- a/components/ILIAS/Refinery/tests/Numeric/GroupTest.php +++ b/components/ILIAS/Refinery/tests/Numeric/GroupTest.php @@ -24,18 +24,18 @@ use ILIAS\Refinery\Numeric\IsNumeric; use ILIAS\Refinery\Numeric\Group as NumericGroup; use PHPUnit\Framework\TestCase; -use ilLanguage; +use ILIAS\Language\Language; class GroupTest extends TestCase { private NumericGroup $group; private DataFactory $dataFactory; - private ilLanguage $language; + private ILIAS\Language\Language $language; protected function setUp(): void { $this->dataFactory = new DataFactory(); - $this->language = $this->getMockBuilder(ilLanguage::class) + $this->language = $this->getMockBuilder(ILIAS\Language\Language::class) ->disableOriginalConstructor() ->getMock(); diff --git a/components/ILIAS/Refinery/tests/Numeric/Validation/IsNumericConstraintTest.php b/components/ILIAS/Refinery/tests/Numeric/Validation/IsNumericConstraintTest.php index 17b0d5ba7f0d..773649e46df0 100755 --- a/components/ILIAS/Refinery/tests/Numeric/Validation/IsNumericConstraintTest.php +++ b/components/ILIAS/Refinery/tests/Numeric/Validation/IsNumericConstraintTest.php @@ -25,14 +25,14 @@ class IsNumericConstraintTest extends TestCase { private DataFactory $df; - private ilLanguage $lng; + private ILIAS\Language\Language $lng; private Refinery $f; private \ILIAS\Refinery\Constraint $c; protected function setUp(): void { $this->df = new DataFactory(); - $this->lng = $this->createMock(ilLanguage::class); + $this->lng = $this->createMock(ILIAS\Language\Language::class); $this->f = new Refinery($this->df, $this->lng); diff --git a/components/ILIAS/Refinery/tests/Password/Constraint/PasswordContraintsTest.php b/components/ILIAS/Refinery/tests/Password/Constraint/PasswordContraintsTest.php index ef28c89d3cad..0e3193e757be 100755 --- a/components/ILIAS/Refinery/tests/Password/Constraint/PasswordContraintsTest.php +++ b/components/ILIAS/Refinery/tests/Password/Constraint/PasswordContraintsTest.php @@ -30,7 +30,7 @@ class PasswordContraintsTest extends TestCase */ public function constraintsProvider(): array { - $lng = $this->createMock(\ilLanguage::class); + $lng = $this->createMock(\ILIAS\Language\Language::class); $d = new \ILIAS\Data\Factory(); $refinery = new \ILIAS\Refinery\Factory($d, $lng); $v = $refinery->password(); diff --git a/components/ILIAS/Refinery/tests/Password/GroupTest.php b/components/ILIAS/Refinery/tests/Password/GroupTest.php index 4480d1a4746f..77e081b83a5c 100755 --- a/components/ILIAS/Refinery/tests/Password/GroupTest.php +++ b/components/ILIAS/Refinery/tests/Password/GroupTest.php @@ -28,18 +28,18 @@ use ILIAS\Refinery\Password\HasUpperChars; use ILIAS\Refinery\Password\Group as PasswordGroup; use PHPUnit\Framework\TestCase; -use ilLanguage; +use ILIAS\Language\Language; class GroupTest extends TestCase { private PasswordGroup $group; private DataFactory $dataFactory; - private ilLanguage $language; + private ILIAS\Language\Language $language; protected function setUp(): void { $this->dataFactory = new DataFactory(); - $this->language = $this->getMockBuilder(ilLanguage::class) + $this->language = $this->getMockBuilder(ILIAS\Language\Language::class) ->disableOriginalConstructor() ->getMock(); diff --git a/components/ILIAS/Refinery/tests/String/Constraints/HasMaxLengthConstraintTest.php b/components/ILIAS/Refinery/tests/String/Constraints/HasMaxLengthConstraintTest.php index ea157882eb0c..cb9934f2d083 100755 --- a/components/ILIAS/Refinery/tests/String/Constraints/HasMaxLengthConstraintTest.php +++ b/components/ILIAS/Refinery/tests/String/Constraints/HasMaxLengthConstraintTest.php @@ -26,14 +26,14 @@ class HasMaxLengthConstraintTest extends TestCase { private DataFactory $df; - private ilLanguage $lng; + private ILIAS\Language\Language $lng; private int $max_length; private Constraint $c; protected function setUp(): void { $this->df = new DataFactory(); - $this->lng = $this->createMock(ilLanguage::class); + $this->lng = $this->createMock(ILIAS\Language\Language::class); $this->max_length = 2; diff --git a/components/ILIAS/Refinery/tests/String/Constraints/HasMinLengthConstraintTest.php b/components/ILIAS/Refinery/tests/String/Constraints/HasMinLengthConstraintTest.php index 6a967dcf288e..6c4d27e9cae9 100755 --- a/components/ILIAS/Refinery/tests/String/Constraints/HasMinLengthConstraintTest.php +++ b/components/ILIAS/Refinery/tests/String/Constraints/HasMinLengthConstraintTest.php @@ -26,14 +26,14 @@ class HasMinLengthConstraintTest extends TestCase { private DataFactory $df; - private ilLanguage $lng; + private ILIAS\Language\Language $lng; private int $min_length; private Constraint $c; protected function setUp(): void { $this->df = new DataFactory(); - $this->lng = $this->createMock(ilLanguage::class); + $this->lng = $this->createMock(ILIAS\Language\Language::class); $this->min_length = 10; diff --git a/components/ILIAS/Refinery/tests/String/EstimatedReadingTimeTest.php b/components/ILIAS/Refinery/tests/String/EstimatedReadingTimeTest.php index 4516dc71bcbb..cb75d517ec1f 100755 --- a/components/ILIAS/Refinery/tests/String/EstimatedReadingTimeTest.php +++ b/components/ILIAS/Refinery/tests/String/EstimatedReadingTimeTest.php @@ -24,7 +24,7 @@ use ILIAS\Refinery\Factory as Refinery; use ILIAS\Data\Factory as DataFactory; -use ilLanguage; +use ILIAS\Language\Language; use PHPUnit\Framework\TestCase; use stdClass; use InvalidArgumentException; @@ -48,7 +48,7 @@ protected function setUp(): void { $this->refinery = new Refinery( $this->createMock(DataFactory::class), - $this->createMock(ilLanguage::class) + $this->createMock(ILIAS\Language\Language::class) ); parent::setUp(); diff --git a/components/ILIAS/Refinery/tests/String/GroupTest.php b/components/ILIAS/Refinery/tests/String/GroupTest.php index f899b7478047..eb896da92667 100755 --- a/components/ILIAS/Refinery/tests/String/GroupTest.php +++ b/components/ILIAS/Refinery/tests/String/GroupTest.php @@ -26,7 +26,7 @@ use ILIAS\Refinery\String\HasMaxLength; use PHPUnit\Framework\TestCase; use ILIAS\Refinery\String\MakeClickable; -use ilLanguage; +use ILIAS\Language\Language; class GroupTest extends TestCase { @@ -35,7 +35,7 @@ class GroupTest extends TestCase protected function setUp(): void { $dataFactory = new DataFactory(); - $language = $this->getMockBuilder(ilLanguage::class) + $language = $this->getMockBuilder(ILIAS\Language\Language::class) ->disableOriginalConstructor() ->getMock(); diff --git a/components/ILIAS/Refinery/tests/String/LevenshteinTest.php b/components/ILIAS/Refinery/tests/String/LevenshteinTest.php index 40169074950c..ab07deea50cc 100755 --- a/components/ILIAS/Refinery/tests/String/LevenshteinTest.php +++ b/components/ILIAS/Refinery/tests/String/LevenshteinTest.php @@ -23,7 +23,7 @@ use ILIAS\Data\Factory; use ILIAS\Refinery\String\Group; use PHPUnit\Framework\TestCase; -use ilLanguage; +use ILIAS\Language\Language; use InvalidArgumentException; class LevenshteinTest extends TestCase @@ -51,7 +51,7 @@ class LevenshteinTest extends TestCase public function setUp(): void { $this->factory = new Factory(); - $language = $this->getMockBuilder(ilLanguage::class) + $language = $this->getMockBuilder(ILIAS\Language\Language::class) ->disableOriginalConstructor() ->getMock(); $this->group = new Group($this->factory, $language); diff --git a/components/ILIAS/Refinery/tests/String/MarkdownFormattingToHTMLTest.php b/components/ILIAS/Refinery/tests/String/MarkdownFormattingToHTMLTest.php index 8dfc2644e616..1ee30ee3ae9d 100755 --- a/components/ILIAS/Refinery/tests/String/MarkdownFormattingToHTMLTest.php +++ b/components/ILIAS/Refinery/tests/String/MarkdownFormattingToHTMLTest.php @@ -23,7 +23,7 @@ use ILIAS\Data\Factory; use ILIAS\Refinery\String\Group; use PHPUnit\Framework\TestCase; -use ilLanguage; +use ILIAS\Language\Language; use InvalidArgumentException; use ILIAS\Refinery\String\Transformation\UTFNormalTransformation; use ILIAS\Refinery\Transformation; @@ -34,7 +34,7 @@ class MarkdownFormattingToHTMLTest extends TestCase protected function setUp(): void { - $language = $this->getMockBuilder(ilLanguage::class) + $language = $this->getMockBuilder(ILIAS\Language\Language::class) ->disableOriginalConstructor() ->getMock(); $group = new Group(new Factory(), $language); diff --git a/components/ILIAS/Refinery/tests/String/StripTagsTest.php b/components/ILIAS/Refinery/tests/String/StripTagsTest.php index 442f38b2299b..b531e46937df 100755 --- a/components/ILIAS/Refinery/tests/String/StripTagsTest.php +++ b/components/ILIAS/Refinery/tests/String/StripTagsTest.php @@ -35,7 +35,7 @@ protected function setUp(): void { $this->f = new Refinery( $this->createMock(DataFactory::class), - $language = $this->createMock(ilLanguage::class) + $language = $this->createMock(ILIAS\Language\Language::class) ); $this->strip_tags = $this->f->string()->stripTags(); } diff --git a/components/ILIAS/Refinery/tests/String/Transformation/CaseOfLabelTest.php b/components/ILIAS/Refinery/tests/String/Transformation/CaseOfLabelTest.php index 409ec144082b..bcc22523ec03 100755 --- a/components/ILIAS/Refinery/tests/String/Transformation/CaseOfLabelTest.php +++ b/components/ILIAS/Refinery/tests/String/Transformation/CaseOfLabelTest.php @@ -41,7 +41,7 @@ protected function setUp(): void { $dataFactory = new DataFactory(); - $language = $this->createMock(ilLanguage::class); + $language = $this->createMock(ILIAS\Language\Language::class); $this->f = new Refinery($dataFactory, $language); $this->case_of_label_if_possible = $this->f->string()->caseOfLabel(self::LANGUAGE_KEY); diff --git a/components/ILIAS/Refinery/tests/String/Transformation/SplitStringTest.php b/components/ILIAS/Refinery/tests/String/Transformation/SplitStringTest.php index b2d5703fb0fd..6bea939cfe12 100755 --- a/components/ILIAS/Refinery/tests/String/Transformation/SplitStringTest.php +++ b/components/ILIAS/Refinery/tests/String/Transformation/SplitStringTest.php @@ -36,7 +36,7 @@ class SplitStringTest extends TestCase protected function setUp(): void { $dataFactory = new DataFactory(); - $language = $this->createMock(ilLanguage::class); + $language = $this->createMock(ILIAS\Language\Language::class); $this->f = new Refinery($dataFactory, $language); $this->split_string = $this->f->string()->splitString("#"); } diff --git a/components/ILIAS/Refinery/tests/String/UTFNormalTest.php b/components/ILIAS/Refinery/tests/String/UTFNormalTest.php index 29db958480a7..9224f87fdc33 100755 --- a/components/ILIAS/Refinery/tests/String/UTFNormalTest.php +++ b/components/ILIAS/Refinery/tests/String/UTFNormalTest.php @@ -23,7 +23,7 @@ use ILIAS\Data\Factory; use ILIAS\Refinery\String\Group; use PHPUnit\Framework\TestCase; -use ilLanguage; +use ILIAS\Language\Language; use InvalidArgumentException; use ILIAS\Refinery\String\Transformation\UTFNormalTransformation; use ILIAS\Refinery\Transformation; @@ -37,7 +37,7 @@ class UTFNormalTest extends TestCase public function setUp(): void { - $language = $this->getMockBuilder(ilLanguage::class) + $language = $this->getMockBuilder(ILIAS\Language\Language::class) ->disableOriginalConstructor() ->getMock(); $group = new Group(new Factory(), $language); diff --git a/components/ILIAS/Refinery/tests/TestCase.php b/components/ILIAS/Refinery/tests/TestCase.php index 7a3aeb9086bf..34ea214a9cea 100755 --- a/components/ILIAS/Refinery/tests/TestCase.php +++ b/components/ILIAS/Refinery/tests/TestCase.php @@ -21,10 +21,10 @@ namespace ILIAS\Tests\Refinery; use ilGlobalTemplateInterface; -use ilLanguage; +use ILIAS\Language\Language; use PHPUnit\Framework\TestCase as PHPUnitTestCase; -class ilLanguageMock extends ilLanguage +class ilLanguageMock implements \ILIAS\Language\Language { /** @var string[] */ public array $requested = []; @@ -51,8 +51,8 @@ public function loadLanguageModule(string $a_module): void abstract class TestCase extends PHPUnitTestCase { - public function getLanguage(): ilLanguageMock + public function getLanguage(): ILIAS\Language\LanguageMock { - return new ilLanguageMock(); + return new ILIAS\Language\LanguageMock(); } }