Skip to content

Commit

Permalink
Merge branch 'bcit-ci:develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
gxgpet authored Dec 4, 2022
2 parents fb1256a + 7eda20f commit ff28f9d
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 14 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/test-phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: PHPUnit

on: [push, pull_request]

permissions:
contents: read

jobs:
tests:
runs-on: ubuntu-18.04
Expand Down
2 changes: 1 addition & 1 deletion readme.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ agreement <https://github.com/bcit-ci/CodeIgniter/blob/develop/user_guide_src/so
Resources
*********

- `User Guide <https://codeigniter.com/docs>`_
- `User Guide <https://codeigniter.com/userguide3/>`_
- `Contributing Guide <https://github.com/bcit-ci/CodeIgniter/blob/develop/contributing.md>`_
- `Language File Translations <https://github.com/bcit-ci/codeigniter3-translations>`_
- `Community Forums <https://forum.codeigniter.com/>`_
Expand Down
6 changes: 3 additions & 3 deletions system/database/DB_query_builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -692,11 +692,11 @@ protected function _wh($qb_key, $key, $value = NULL, $type = 'AND ', $escape = N
$k = substr($k, 0, $match[0][1]).($match[1][0] === '=' ? ' IS NULL' : ' IS NOT NULL');
}

${$qb_key} = array('condition' => $prefix.$k, 'value' => $v, 'escape' => $escape);
$this->{$qb_key}[] = ${$qb_key};
$$qb_key = array('condition' => $prefix.$k, 'value' => $v, 'escape' => $escape);
$this->{$qb_key}[] = $$qb_key;
if ($this->qb_caching === TRUE)
{
$this->{$qb_cache_key}[] = ${$qb_key};
$this->{$qb_cache_key}[] = $$qb_key;
$this->qb_cache_exists[] = substr($qb_key, 3);
}

Expand Down
2 changes: 1 addition & 1 deletion system/libraries/Xmlrpc.php
Original file line number Diff line number Diff line change
Expand Up @@ -1719,7 +1719,7 @@ public function addScalar($val, $type = 'string')

if ($typeof != 1)
{
echo '<strong>XML_RPC_Values</strong>: not a scalar type (${typeof})<br />';
echo "<strong>XML_RPC_Values</strong>: not a scalar type ($typeof)<br />";
return 0;
}

Expand Down
4 changes: 2 additions & 2 deletions system/libraries/Xmlrpcs.php
Original file line number Diff line number Diff line change
Expand Up @@ -551,8 +551,8 @@ public function multicall($m)
*/
public function multicall_error($err)
{
$str = is_string($err) ? $this->xmlrpcstr["multicall_${err}"] : $err->faultString();
$code = is_string($err) ? $this->xmlrpcerr["multicall_${err}"] : $err->faultCode();
$str = is_string($err) ? $this->xmlrpcstr["multicall_$err"] : $err->faultString();
$code = is_string($err) ? $this->xmlrpcerr["multicall_$err"] : $err->faultCode();

$struct['faultCode'] = new XML_RPC_Values($code, 'int');
$struct['faultString'] = new XML_RPC_Values($str, 'string');
Expand Down
6 changes: 3 additions & 3 deletions tests/codeigniter/core/Log_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ public function test_configuration()
$enabled = new ReflectionProperty('CI_Log', '_enabled');
$enabled->setAccessible(TRUE);

$this->ci_set_config('log_path', '/root/');
$this->ci_set_config('log_path', $this->ci_readonly_dir->url());
$this->ci_set_config('log_threshold', 'z');
$this->ci_set_config('log_date_format', 'd.m.Y');
$this->ci_set_config('log_filename', '');
$this->ci_set_config('log_file_permissions', '');
$instance = new CI_Log();

$this->assertEquals($path->getValue($instance), '/root/');
$this->assertNotFalse(strpos($path->getValue($instance), 'application/readonly'));
$this->assertEquals($threshold->getValue($instance), 1);
$this->assertEquals($date_fmt->getValue($instance), 'd.m.Y');
$this->assertEquals($filename->getValue($instance), 'log-'.date('Y-m-d').'.php');
Expand All @@ -37,7 +37,7 @@ public function test_configuration()
$this->ci_set_config('log_file_permissions', 0600);
$instance = new CI_Log();

$this->assertEquals($path->getValue($instance), APPPATH.'logs/');
$this->assertEquals($path->getValue($instance), $this->ci_vfs_root->url().'application/logs'.DIRECTORY_SEPARATOR);
$this->assertEquals($threshold->getValue($instance), 0);
$this->assertEquals($date_fmt->getValue($instance), 'Y-m-d H:i:s');
$this->assertEquals($filename->getValue($instance), 'testname.log');
Expand Down
6 changes: 3 additions & 3 deletions tests/codeigniter/core/Security_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,9 @@ public function test_xss_hash()
// Perform hash
$this->security->xss_hash();

$assertRegExp = class_exists('PHPUnit_Runner_Version')
? 'assertRegExp'
: 'assertMatchesRegularExpression';
$assertRegExp = method_exists($this, 'assertMatchesRegularExpression')
? 'assertMatchesRegularExpression'
: 'assertRegExp';
$this->$assertRegExp('#^[0-9a-f]{32}$#iS', $this->security->xss_hash);
}

Expand Down
2 changes: 2 additions & 0 deletions tests/mocks/ci_testcase.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class CI_TestCase extends \PHPUnit\Framework\TestCase {
public $ci_vfs_root;
public $ci_app_root;
public $ci_base_root;
public $ci_readonly_dir;
protected $ci_instance;
protected static $ci_test_instance;

Expand Down Expand Up @@ -40,6 +41,7 @@ public function setUp()
$this->ci_app_root = vfsStream::newDirectory('application')->at($this->ci_vfs_root);
$this->ci_base_root = vfsStream::newDirectory('system')->at($this->ci_vfs_root);
$this->ci_view_root = vfsStream::newDirectory('views')->at($this->ci_app_root);
$this->ci_readonly_dir = vfsStream::newDirectory('readonly', 555)->at($this->ci_app_root);

if (method_exists($this, 'set_up'))
{
Expand Down
2 changes: 1 addition & 1 deletion user_guide_src/source/tutorial/news_section.rst
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ so it can be used in all other methods in this controller.
It also loads a collection of :doc:`URL Helper <../helpers/url_helper>`
functions, because we'll use one of them in a view later.

Next, there are two methods to view all news items and one for a specific
Next, there are two methods to view news items: one for all news items and one for a specific
news item. You can see that the ``$slug`` variable is passed to the model's
method in the second method. The model is using this slug to identify the
news item to be returned.
Expand Down

0 comments on commit ff28f9d

Please sign in to comment.