From fb1256a5b009b6264fbc85be44e0d97654d3fcd9 Mon Sep 17 00:00:00 2001
From: George Petculescu <gxgpet@gmail.com>
Date: Sun, 6 Nov 2022 16:13:43 +0200
Subject: [PATCH] Adding PHP 8.2 support

---
 .github/workflows/test-phpunit.yml          | 20 +++++++++++++++++++-
 system/core/Loader.php                      |  1 +
 system/core/URI.php                         |  7 +++++++
 system/database/DB_driver.php               |  1 +
 system/libraries/Driver.php                 |  1 +
 system/libraries/Table.php                  |  4 ++--
 tests/codeigniter/core/Loader_test.php      |  2 +-
 tests/codeigniter/libraries/Upload_test.php |  7 ++++---
 tests/mocks/ci_testcase.php                 |  1 +
 9 files changed, 37 insertions(+), 7 deletions(-)

--- a/tests/codeigniter/core/Loader_test.php
+++ b/tests/codeigniter/core/Loader_test.php
@@ -125,7 +125,7 @@
 		// Create library in VFS
 		$lib = 'unit_test_config_lib';
 		$class = 'CI_'.ucfirst($lib);
-		$content = '<?php class '.$class.' { public function __construct($params) { $this->config = $params; } }';
+		$content = "<?php \n#[AllowDynamicProperties]\nclass ".$class.' { public function __construct($params) { $this->config = $params; } }';
 		$this->ci_vfs_create(ucfirst($lib), $content, $this->ci_base_root, 'libraries');
 
 		// Create config file
--- a/tests/codeigniter/libraries/Upload_test.php
+++ b/tests/codeigniter/libraries/Upload_test.php
@@ -59,9 +59,6 @@
 		$data = array(
 				'file_name'		=> 'hello.txt',
 				'file_type'		=> 'text/plain',
-				'file_path'		=> '/tmp/',
-				'full_path'		=> '/tmp/hello.txt',
-				'raw_name'		=> 'hello',
 				'orig_name'		=> 'hello.txt',
 				'client_name'		=> '',
 				'file_ext'		=> '.txt',
@@ -80,6 +77,10 @@
 			$this->upload->{$k}	= $v;
 		}
 
+		$data['file_path'] = '/tmp/';
+		$data['full_path'] = '/tmp/hello.txt';
+		$data['raw_name'] = 'hello';
+
 		$this->assertEquals('hello.txt', $this->upload->data('file_name'));
 		$this->assertEquals($data, $this->upload->data());
 	}
--- a/tests/mocks/ci_testcase.php
+++ b/tests/mocks/ci_testcase.php
@@ -1,5 +1,6 @@
 <?php
 
+#[AllowDynamicProperties]
 class CI_TestCase extends \PHPUnit\Framework\TestCase {
 
 	public $ci_vfs_root;
