Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [8.3, 8.4]
php: [8.4, 8.5]
nodejs: [ 22.x, 24.x ]
steps:
- name: Checkout code
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: install-check-trunk-8.3
name: install-check-trunk-8.5
on:
schedule:
- cron: "0 12 * * *"
Expand All @@ -11,7 +11,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [8.3]
php: [8.5]
env:
DB_DATABASE: ilias
DB_USER: root
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/legacy-ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
php-version: 8.4
extensions: dom, curl, libxml, mbstring, zip, gd, json, readline, xsl, xml, mysql
tools: composer:v2
coverage: none
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[![checks](https://github.com/ILIAS-eLearning/ILIAS/actions/workflows/checks.yml/badge.svg?branch=trunk)](https://github.com/ILIAS-eLearning/ILIAS/actions/workflows/checks.yml)
[![Supported PHP Version](https://img.shields.io/badge/php-%3E%3D8.3%7C%3C%3D8.4-8892BF.svg)](https://php.net/)
[![Supported PHP Version](https://img.shields.io/badge/php-%3E%3D8.4%7C%3C%3D8.5-8892BF.svg)](https://php.net/)

# ILIAS

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ public function testConstruct(): void
public function testGlobalRecordSorting(): void
{
$record_id_reflection = new ReflectionMethod(ilAdvancedMDRecord::class, 'setRecordId');
$record_id_reflection->setAccessible(true);

$ids = [1, 2, 3, 4, 5];
$positions = array_reverse($ids);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ protected function setUp(): void

$settingsReflection = new ReflectionClass(ilSetting::class);
$cache = $settingsReflection->getProperty('settings_cache');
$cache->setAccessible(true);
$cache->setValue($settingsReflection, []);

$this->access = new ilObjChatroomAccess();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ public function getArrayCopy(): array
$a = [];
$r = new ReflectionClass($this);
foreach ($r->getProperties() as $p) {
$p->setAccessible(true);
$a[$p->getName()] = $p->getValue($this);
}
return $a;
Expand Down
1 change: 0 additions & 1 deletion components/ILIAS/File/tests/ilModulesFileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ public function testAppendStream(): void

$r = new ReflectionClass(ilObjFile::class);
$property = $r->getProperty('just_notified');
$property->setAccessible(true);
$property->setValue($file, true);
$file->setMode(ilObjFile::MODE_FILELIST);
$this->db_mock
Expand Down
1 change: 0 additions & 1 deletion components/ILIAS/Mail/tests/ilMailAddressTypesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ private function getWrappedAddressType(ilMailAddressType $type): ilMailAddressTy
if ($type instanceof ilMailCachedAddressType) {
$refl = new ReflectionObject($type);
$inner = $refl->getProperty('inner');
$inner->setAccessible(true);

return $inner->getValue($type);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ class DateTimeTransformation implements Transformation
use DeriveApplyToFromTransform;
use DeriveInvokeFromTransform;

private const string RFC7231 = 'D, d M Y H:i:s \G\M\T';

/**
* @inheritDoc
*/
Expand All @@ -53,7 +55,7 @@ public function transform($from): DateTimeImmutable
DateTimeInterface::COOKIE,
DateTimeInterface::ISO8601,
DateTimeInterface::RFC822,
DateTimeInterface::RFC7231,
self::RFC7231, // DateTimeInterface::RFC7231 format (deprecated constant in PHP 8.5)
DateTimeInterface::RFC3339_EXTENDED
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
use ILIAS\Refinery\KindlyTo\Transformation\DateTimeTransformation;
use PHPUnit\Framework\TestCase;
use PHPUnit\Framework\Attributes\DataProvider;
use DateTimeZone;

class DateTimeTransformationTest extends TestCase
{
Expand All @@ -45,6 +46,29 @@ public function testDateTimeISOTransformation(mixed $originVal, DateTimeImmutabl
$this->assertEquals($expectedVal, $transformedValue);
}

/**
* @see https://github.com/php/php-src/pull/2450
* @see https://github.com/php/php-src/pull/12989
*/
public function testRFC7231ResultsInMisleadingFormattedDateString(): void
{
$gmt_format = 'D, d M Y H:i:s \G\M\T'; // former DateTimeInterface::RFC7231
$test_gmt_date_time = 'Mon, 06 Jul 2020 12:23:05 GMT';

$exptected = DateTimeImmutable::createFromFormat(
$gmt_format,
$test_gmt_date_time
);

$actual = $this->transformation->transform($test_gmt_date_time);
$this->assertEquals($exptected, $actual);

$actual = $actual->setTimezone(new DateTimeZone('Europe/Berlin'));
// GMT in the provided format is just a string, it does not effect the presented timezone
$this->assertSame('Mon, 06 Jul 2020 14:23:05 GMT', $actual->format($gmt_format));
$this->assertEquals($exptected, $actual);
}

#[DataProvider('TransformationFailureDataProvider')]
public function testTransformIsInvalid(string $failingValue): void
{
Expand All @@ -57,20 +81,47 @@ public static function DateTimeTransformationDataProvider(): array
$now = new DateTimeImmutable();
return [
'datetime' => [$now, $now],
'iso8601' => ['2020-07-06T12:23:05+0000',
DateTimeImmutable::createFromFormat(DateTimeInterface::ISO8601, '2020-07-06T12:23:05+0000')],
'atom' => ['2020-07-06T12:23:05+00:00',
DateTimeImmutable::createFromFormat(DateTimeInterface::ATOM, '2020-07-06T12:23:05+00:00')],
'rfc3339_ext' => ['2020-07-06T12:23:05.000+00:00',
DateTimeImmutable::createFromFormat(DateTimeInterface::RFC3339_EXTENDED, '2020-07-06T12:23:05.000+00:00')],
'cookie' => ['Monday, 06-Jul-2020 12:23:05 GMT+0000',
DateTimeImmutable::createFromFormat(DateTimeInterface::COOKIE, 'Monday, 06-Jul-2020 12:23:05 GMT+0000')],
'rfc822' => ['Mon, 06 Jul 20 12:23:05 +0000',
DateTimeImmutable::createFromFormat(DateTimeInterface::RFC822, 'Mon, 06 Jul 20 12:23:05 +0000')],
'rfc7231' => ['Mon, 06 Jul 2020 12:23:05 GMT',
DateTimeImmutable::createFromFormat(DateTimeInterface::RFC7231, 'Mon, 06 Jul 2020 12:23:05 GMT')],
'unix_timestamp' => [481556262, DateTimeImmutable::createFromFormat(DateTimeInterface::ISO8601, '1985-04-05T13:37:42+0000')],
'unix_timestamp_float' => [481556262.4, DateTimeImmutable::createFromFormat(DateTimeInterface::ISO8601, '1985-04-05T13:37:42+0000')]
'iso8601' => [
'2020-07-06T12:23:05+0000',
DateTimeImmutable::createFromFormat(DateTimeInterface::ISO8601, '2020-07-06T12:23:05+0000')
],
'atom' => [
'2020-07-06T12:23:05+00:00',
DateTimeImmutable::createFromFormat(DateTimeInterface::ATOM, '2020-07-06T12:23:05+00:00')
],
'rfc3339_ext' => [
'2020-07-06T12:23:05.000+00:00',
DateTimeImmutable::createFromFormat(
DateTimeInterface::RFC3339_EXTENDED,
'2020-07-06T12:23:05.000+00:00'
)
],
'cookie' => [
'Monday, 06-Jul-2020 12:23:05 GMT+0000',
DateTimeImmutable::createFromFormat(DateTimeInterface::COOKIE, 'Monday, 06-Jul-2020 12:23:05 GMT+0000')
],
'rfc822' => [
'Mon, 06 Jul 20 12:23:05 +0000',
DateTimeImmutable::createFromFormat(DateTimeInterface::RFC822, 'Mon, 06 Jul 20 12:23:05 +0000')
],
'rfc7231' => [
'Mon, 06 Jul 2020 12:23:05 GMT',
DateTimeImmutable::createFromFormat('D, d M Y H:i:s \G\M\T', 'Mon, 06 Jul 2020 12:23:05 GMT')
],
'unix_timestamp' => [
481556262,
DateTimeImmutable::createFromFormat(
DateTimeInterface::ISO8601,
'1985-04-05T13:37:42+0000'
)
],
'unix_timestamp_float' => [
481556262.4,
DateTimeImmutable::createFromFormat(
DateTimeInterface::ISO8601,
'1985-04-05T13:37:42+0000'
)
]
];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ public function testAddOriginalSkillTitle(): void
$this->testObj->addOriginalSkillTitle($skillBaseId, $skillTrefId, $originalSkillTitle);

$reflProp = new ReflectionProperty($this->testObj, 'originalSkillTitles');
$reflProp->setAccessible(true);

$this->assertEquals(["$skillBaseId:$skillTrefId" => $originalSkillTitle], $reflProp->getValue($this->testObj));
}
Expand All @@ -59,7 +58,6 @@ public function testAddOriginalSkillPath(): void
$this->testObj->addOriginalSkillPath($skillBaseId, $skillTrefId, $originalSkillPath);

$reflProp = new ReflectionProperty($this->testObj, 'originalSkillPaths');
$reflProp->setAccessible(true);

$this->assertEquals(["$skillBaseId:$skillTrefId" => $originalSkillPath], $reflProp->getValue($this->testObj));
}
Expand All @@ -70,7 +68,6 @@ public function testAddSkillLevelThreshold(): void
$this->testObj->addSkillLevelThreshold($testSkillLevelThresholdImport);

$reflProp = new ReflectionProperty($this->testObj, 'importedSkillLevelThresholds');
$reflProp->setAccessible(true);

$this->assertEquals([$testSkillLevelThresholdImport], $reflProp->getValue($this->testObj));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,10 @@ private function completeParsedErrorTextFromErrorData(): void
{
foreach ($this->errordata as $error) {
$position = $error->getPosition();
if ($position === null) {
continue;
}

foreach ($this->getParsedErrorText() as $key => $paragraph) {
if (array_key_exists($position, $paragraph)) {
$this->parsed_errortext[$key][$position]['text_correct'] =
Expand Down Expand Up @@ -905,7 +909,11 @@ private function generateArrayByPositionFromErrorData(): array
{
$array_by_position = [];
foreach ($this->errordata as $error) {
$array_by_position[$error->getPosition()] = [
$position = $error->getPosition();
if ($position === null) {
continue;
}
$array_by_position[$position] = [
'length' => $error->getLength(),
'points' => $error->getPoints(),
'text' => $error->getTextWrong(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ protected static function getMethod($name): ReflectionMethod
{
$class = new ReflectionClass(assLongMenu::class);
$method = $class->getMethod($name);
$method->setAccessible(true);
return $method;
}

Expand Down
2 changes: 0 additions & 2 deletions components/ILIAS/Tree/tests/ilRepositoryTreeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ public function testInitLanguage(): void
$tree = new ilTree(1);
$tree->initLangCode();
$tree_reflection = new ReflectionProperty($tree, 'lang_code');
$tree_reflection->setAccessible(true);
$this->assertEquals('en', $tree_reflection->getValue($tree));

// user getCurrentLanguage() from session is empty
Expand All @@ -69,7 +68,6 @@ public function testInitLanguage(): void
$this->setGlobalVariable('ilUser', $user);
$tree->initLangCode();
$tree_reflection = new ReflectionProperty($tree, 'lang_code');
$tree_reflection->setAccessible(true);
$this->assertEquals('en', $tree_reflection->getValue($tree));
}

Expand Down
4 changes: 2 additions & 2 deletions components/ILIAS/setup_/classes/class.ilCommonSetupAgent.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
class ilCommonSetupAgent implements Setup\Agent
{
private const PHP_MEMORY_LIMIT = "128M";
private const PHP_MIN_VERSION = "8.3.0";
private const PHP_MAX_VERSION = "8.4.999";
private const PHP_MIN_VERSION = "8.4.0";
private const PHP_MAX_VERSION = "8.5.999";

protected Refinery\Factory $refinery;
protected Data\Factory $data;
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
]
},
"require": {
"php": ">=8.3 <8.5",
"php": ">=8.4 <8.6",
"ext-gd": "*",
"ext-dom": "*",
"ext-xsl": "*",
Expand All @@ -58,7 +58,7 @@
"guzzlehttp/psr7": "2.7.0",
"ifsnop/mysqldump-php": "2.11",
"james-heinrich/getid3": "^1.9.23",
"league/commonmark": "2.7.0",
"league/commonmark": "^2.8",
"league/flysystem": "3.28.0",
"monolog/monolog": "^3.9",
"mustache/mustache": "^3.0",
Expand Down
Loading