Skip to content

Commit

Permalink
Merge pull request #2 from cloudbeds/feat/php8.2-3.1.13
Browse files Browse the repository at this point in the history
3.1.13-Stable with Deprecation Fixes
  • Loading branch information
charlesportwoodii-cb authored Jul 29, 2024
2 parents 45576ef + e8d353e commit ec121f8
Show file tree
Hide file tree
Showing 33 changed files with 99 additions and 57 deletions.
41 changes: 10 additions & 31 deletions .github/workflows/test-phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,67 +4,46 @@ on: [push, pull_request]

jobs:
tests:
runs-on: ubuntu-18.04
runs-on: ubuntu-24.04
if: "!contains(github.event.head_commit.message, '[ci skip]')"
env:
PHP_INI_VALUES: assert.exception=1, zend.assertions=1

strategy:
fail-fast: false
matrix:
php: [ '8.1', '8.0', '7.4', '7.3', '7.2', '7.1', '7.0', '5.6', '5.5', '5.4' ]
DB: [ 'pdo/mysql', 'pdo/pgsql', 'pdo/sqlite', 'mysqli', 'pgsql', 'sqlite' ]
php: [ '8.3', '8.2','8.0']
DB: [ 'pdo/mysql', 'pdo/pgsql', 'mysqli', 'pgsql', ]
compiler: [ default ]
include:
- php: '8.1'
- php: '8.2'
DB: 'pdo/mysql'
compiler: jit
- php: '8.1'
- php: '8.2'
DB: 'pdo/pgsql'
compiler: jit
- php: '8.1'
DB: 'pdo/sqlite'
compiler: jit
- php: '8.1'
- php: '8.2'
DB: 'mysqli'
compiler: jit
- php: '8.1'
- php: '8.2'
DB: 'pgsql'
compiler: jit
- php: '8.1'
DB: 'sqlite'
compiler: jit
- php: '8.0'
DB: 'pdo/mysql'
compiler: jit
- php: '8.0'
DB: 'pdo/pgsql'
compiler: jit
- php: '8.0'
DB: 'pdo/sqlite'
compiler: jit
- php: '8.0'
DB: 'mysqli'
compiler: jit
- php: '8.0'
DB: 'pgsql'
compiler: jit
- php: '8.0'
DB: 'sqlite'
compiler: jit
- php: '5.6'
DB: 'mysql'
compiler: default
- php: '5.5'
DB: 'mysql'
compiler: default
- php: '5.4'
DB: 'mysql'
compiler: default

services:
postgres:
image: postgres:12
image: postgres:16
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
Expand All @@ -74,7 +53,7 @@ jobs:
options: --health-cmd=pg_isready --health-interval=10s --health-timeout=5s --health-retries=3

mysql:
image: mysql:5.7
image: mysql:8.0
env:
MYSQL_ALLOW_EMPTY_PASSWORD: true
MYSQL_USER: travis
Expand All @@ -96,7 +75,7 @@ jobs:
with:
php-version: ${{ matrix.php }}
tools: composer, pecl
extensions: imagick, sqlite3, pgsql, mysqli, pdo, pdo_mysql, pdo_pgsql, pdo_sqlite, mbstring
extensions: imagick, sqlite3, pgsql, mysqli, pdo, pdo_mysql, pdo_pgsql, pdo_sqlite
ini-values: ${{ env.PHP_INI_VALUES }}
coverage: xdebug

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ user_guide_src/cilexer/pycilexer.egg-info/*
*.sublime-project
/tests/tests/
/tests/results/
tests/travis/.phpunit.result.cache
4 changes: 4 additions & 0 deletions system/core/Loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@
*/
class CI_Loader {

protected $config;

protected $output;

// All these are set automatically. Don't mess with them.
/**
* Nesting level of the output buffering mechanism
Expand Down
2 changes: 2 additions & 0 deletions system/database/DB_driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
*/
abstract class CI_DB_driver {

public $stricton;

/**
* Data Source Name / Connect string
*
Expand Down
2 changes: 2 additions & 0 deletions system/database/drivers/pdo/subdrivers/pdo_pgsql_forge.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
*/
class CI_DB_pdo_pgsql_forge extends CI_DB_pdo_forge {

protected $create_table_if = 'CREATE TABLE IF EXISTS';

/**
* DROP TABLE IF statement
*
Expand Down
4 changes: 4 additions & 0 deletions system/libraries/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@
*/
class CI_Driver_Library {

public $basic;
public $lowpack;
public $extend;

/**
* Array of drivers that are available to use with the driver class
*
Expand Down
7 changes: 2 additions & 5 deletions system/libraries/Encryption.php
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ protected function _openssl_encrypt($data, $params)
$data,
$params['handle'],
$params['key'],
1, // DO NOT TOUCH!
OPENSSL_RAW_DATA,
$iv
);

Expand Down Expand Up @@ -642,7 +642,7 @@ protected function _openssl_decrypt($data, $params)
$data,
$params['handle'],
$params['key'],
1, // DO NOT TOUCH!
OPENSSL_RAW_DATA,
$iv
);
}
Expand Down Expand Up @@ -929,9 +929,6 @@ protected static function substr($str, $start, $length = NULL)
{
if (self::$func_overload)
{
// mb_substr($str, $start, null, '8bit') returns an empty
// string on PHP 5.3
isset($length) OR $length = ($start >= 0 ? self::strlen($str) - $start : -$start);
return mb_substr($str, $start, $length, '8bit');
}

Expand Down
2 changes: 2 additions & 0 deletions system/libraries/Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@
*/
class CI_Table {

public $temp;

/**
* Data for table rows
*
Expand Down
3 changes: 3 additions & 0 deletions system/libraries/Unit_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@
*/
class CI_Unit_test {

public $config;
public $output;

/**
* Active flag
*
Expand Down
4 changes: 4 additions & 0 deletions system/libraries/Upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@
*/
class CI_Upload {

public $file_path;
public $full_path;
public $raw_name;

/**
* Maximum file size
*
Expand Down
1 change: 1 addition & 0 deletions tests/codeigniter/core/Benchmark_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

class Benchmark_test extends CI_TestCase {

public $benchmark;
public function set_up()
{
$this->benchmark = new CI_Benchmark();
Expand Down
3 changes: 3 additions & 0 deletions tests/codeigniter/core/Config_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

class Config_test extends CI_TestCase {

public $cfg;
public $config;

public function set_up()
{
$cls =& $this->ci_core_class('cfg');
Expand Down
2 changes: 2 additions & 0 deletions tests/codeigniter/core/Input_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

class Input_test extends CI_TestCase {

public $input;

public function set_up()
{
// Set server variable to GET as default, since this will leave unset in STDIN env
Expand Down
32 changes: 17 additions & 15 deletions tests/codeigniter/core/Loader_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

class Loader_test extends CI_TestCase {

public $prefix;
public $load;
private $ci_obj;

public function set_up()
Expand Down Expand Up @@ -36,7 +38,7 @@ public function test_library()
// Test loading as an array.
$this->assertInstanceOf('CI_Loader', $this->load->library(array($lib)));
$this->assertTrue(class_exists($class), $class.' does not exist');
$this->assertObjectHasAttribute($lib, $this->ci_obj);
$this->assertObjectHasProperty($lib, $this->ci_obj);
$this->assertInstanceOf($class, $this->ci_obj->$lib);

// Create library in VFS
Expand Down Expand Up @@ -88,21 +90,21 @@ public function test_library_extension()
$this->assertInstanceOf('CI_Loader', $this->load->library($lib));
$this->assertTrue(class_exists($class), $class.' does not exist');
$this->assertTrue(class_exists($ext), $ext.' does not exist');
$this->assertObjectHasAttribute($name, $this->ci_obj);
$this->assertObjectHasProperty($name, $this->ci_obj);
$this->assertInstanceOf($class, $this->ci_obj->$name);
$this->assertInstanceOf($ext, $this->ci_obj->$name);

// Test reloading with object name
$obj = 'exttest';
$this->assertInstanceOf('CI_Loader', $this->load->library($lib, NULL, $obj));
$this->assertObjectHasAttribute($obj, $this->ci_obj);
$this->assertObjectHasProperty($obj, $this->ci_obj);
$this->assertInstanceOf($class, $this->ci_obj->$obj);
$this->assertInstanceOf($ext, $this->ci_obj->$obj);

// Test reloading
unset($this->ci_obj->$name);
$this->assertInstanceOf('CI_Loader', $this->load->library($lib));
$this->assertObjectHasAttribute($name, $this->ci_obj);
$this->assertObjectHasProperty($name, $this->ci_obj);

// Create baseless library
$name = 'ext_baseless_lib';
Expand All @@ -125,7 +127,7 @@ public function test_library_config()
// 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 class '.$class.' { public $config; public function __construct($params) { $this->config = $params; } }';
$this->ci_vfs_create(ucfirst($lib), $content, $this->ci_base_root, 'libraries');

// Create config file
Expand All @@ -140,7 +142,7 @@ public function test_library_config()
$obj = 'testy';
$this->assertInstanceOf('CI_Loader', $this->load->library($lib, NULL, $obj));
$this->assertTrue(class_exists($class), $class.' does not exist');
$this->assertObjectHasAttribute($obj, $this->ci_obj);
$this->assertObjectHasProperty($obj, $this->ci_obj);
$this->assertInstanceOf($class, $this->ci_obj->$obj);
$this->assertEquals($cfg, $this->ci_obj->$obj->config);

Expand Down Expand Up @@ -172,7 +174,7 @@ public function test_load_library_in_application_dir()

// Was the model class instantiated.
$this->assertTrue(class_exists($class), $class.' does not exist');
$this->assertObjectHasAttribute($lib, $this->ci_obj);
$this->assertObjectHasProperty($lib, $this->ci_obj);
$this->assertInstanceOf($class, $this->ci_obj->$lib);
}

Expand All @@ -193,13 +195,13 @@ class_exists('CI_Driver_Library', TRUE);
// Test loading as an array.
$this->assertInstanceOf('CI_Loader', $this->load->driver(array($driver)));
$this->assertTrue(class_exists($class), $class.' does not exist');
$this->assertObjectHasAttribute($driver, $this->ci_obj);
$this->assertObjectHasProperty($driver, $this->ci_obj);
$this->assertInstanceOf($class, $this->ci_obj->$driver);

// Test loading as a library with a name
$obj = 'testdrive';
$this->assertInstanceOf('CI_Loader', $this->load->library($driver, NULL, $obj));
$this->assertObjectHasAttribute($obj, $this->ci_obj);
$this->assertObjectHasProperty($obj, $this->ci_obj);
$this->assertInstanceOf($class, $this->ci_obj->$obj);

// Test a string given to params
Expand All @@ -222,7 +224,7 @@ public function test_models()

// Was the model class instantiated.
$this->assertTrue(class_exists($model));
$this->assertObjectHasAttribute($model, $this->ci_obj);
$this->assertObjectHasProperty($model, $this->ci_obj);

// Test no model given
$this->assertInstanceOf('CI_Loader', $this->load->model(''));
Expand All @@ -248,8 +250,8 @@ public function test_model_subdir()

// Was the model class instantiated?
$this->assertTrue(class_exists($model));
$this->assertObjectHasAttribute($name, $this->ci_obj);
$this->assertObjectHasAttribute($name, $this->ci_obj);
$this->assertObjectHasProperty($name, $this->ci_obj);
$this->assertObjectHasProperty($name, $this->ci_obj);
$this->assertInstanceOf($base, $this->ci_obj->$name);
$this->assertInstanceOf($model, $this->ci_obj->$name);

Expand Down Expand Up @@ -575,17 +577,17 @@ public function test_initialize()

// Verify library
$this->assertTrue(class_exists($lib_class), $lib_class.' does not exist');
$this->assertObjectHasAttribute($lib, $this->ci_obj);
$this->assertObjectHasProperty($lib, $this->ci_obj);
$this->assertInstanceOf($lib_class, $this->ci_obj->$lib);

// Verify driver
$this->assertTrue(class_exists($drv_class), $drv_class.' does not exist');
$this->assertObjectHasAttribute($drv, $this->ci_obj);
$this->assertObjectHasProperty($drv, $this->ci_obj);
$this->assertInstanceOf($drv_class, $this->ci_obj->$drv);

// Verify model
$this->assertTrue(class_exists($model), $model.' does not exist');
$this->assertObjectHasAttribute($model, $this->ci_obj);
$this->assertObjectHasProperty($model, $this->ci_obj);
$this->assertInstanceOf($model, $this->ci_obj->$model);

// Verify config calls
Expand Down
2 changes: 2 additions & 0 deletions tests/codeigniter/core/Model_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

class Model_test extends CI_TestCase {

public $load;

private $ci_obj;

public function set_up()
Expand Down
2 changes: 2 additions & 0 deletions tests/codeigniter/core/Security_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

class Security_test extends CI_TestCase {

public $security;

public function set_up()
{
// Set cookie for security test
Expand Down
2 changes: 2 additions & 0 deletions tests/codeigniter/core/URI_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

class URI_test extends CI_TestCase {

public $uri;

public function set_up()
{
$this->uri = new Mock_Core_URI();
Expand Down
3 changes: 3 additions & 0 deletions tests/codeigniter/database/DB_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

class DB_test extends CI_TestCase {

public $lib;
public $subclass;

public function test_db_invalid()
{
$connection = new Mock_Database_DB(array(
Expand Down
1 change: 1 addition & 0 deletions tests/codeigniter/helpers/date_helper_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

class Date_helper_test extends CI_TestCase {

public $time;
public function set_up()
{
$this->helper('date');
Expand Down
Loading

0 comments on commit ec121f8

Please sign in to comment.