mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-28 14:52:24 +09:00
Fix various warnings in PHP 8.0
This commit is contained in:
parent
f46b41f437
commit
60465fb2db
23 changed files with 65 additions and 55 deletions
|
|
@ -3,6 +3,11 @@
|
|||
class OldSecurityTest extends \Codeception\TestCase\Test
|
||||
{
|
||||
public function _before()
|
||||
{
|
||||
$this->_reset();
|
||||
}
|
||||
|
||||
protected function _reset()
|
||||
{
|
||||
/**
|
||||
* Setup mock data
|
||||
|
|
@ -40,13 +45,13 @@ class OldSecurityTest extends \Codeception\TestCase\Test
|
|||
$this->assertTrue(true);
|
||||
|
||||
// normal string - one
|
||||
$this->_before();
|
||||
$this->_reset();
|
||||
$this->assertEquals('<strong>Hello, world</strong>', Context::get('content1'));
|
||||
$security->encodeHTML('content1');
|
||||
$this->assertEquals('<strong>Hello, world</strong>', Context::get('content1'));
|
||||
|
||||
// normal string - two
|
||||
$this->_before();
|
||||
$this->_reset();
|
||||
$this->assertEquals('<strong>Hello, world</strong>', Context::get('content1'));
|
||||
$this->assertEquals('Wow, >_< !', Context::get('content2'));
|
||||
$security->encodeHTML('content1','content2');
|
||||
|
|
@ -61,7 +66,7 @@ class OldSecurityTest extends \Codeception\TestCase\Test
|
|||
$this->assertEquals(Context::get('array1'), array('<span class="first">F</span>irst','<u>S</u>econd','<b>T</b>hird'));
|
||||
$security->encodeHTML('array1.2'); // affects only third element
|
||||
$this->assertEquals(Context::get('array1'), array('<span class="first">F</span>irst','<u>S</u>econd','<b>T</b>hird'));
|
||||
$this->_before(); // reset;
|
||||
$this->_reset(); // reset;
|
||||
$this->assertEquals(Context::get('array1'), array('<span class="first">F</span>irst','<u>S</u>econd','<b>T</b>hird'));
|
||||
$security->encodeHTML('array1.'); // affects all items
|
||||
$this->assertEquals(Context::get('array1'), array('<span class="first">F</span>irst','<u>S</u>econd','<b>T</b>hird'));
|
||||
|
|
@ -74,7 +79,7 @@ class OldSecurityTest extends \Codeception\TestCase\Test
|
|||
$this->assertEquals(Context::get('array2'), array('elem1'=>'One <ins>1</ins>','elem2'=>'Two <del>2</del>','elem3'=>'Three <addr>3</addr>'));
|
||||
$security->encodeHTML('array2.elem2'); // affects only 'elem2'
|
||||
$this->assertEquals(Context::get('array2'), array('elem1'=>'One <ins>1</ins>','elem2'=>'Two <del>2</del>','elem3'=>'Three <addr>3</addr>'));
|
||||
$this->_before(); // reset;
|
||||
$this->_reset(); // reset;
|
||||
$this->assertEquals(Context::get('array2'), array('elem1'=>'One <ins>1</ins>','elem2'=>'Two <del>2</del>','elem3'=>'Three <addr>3</addr>'));
|
||||
$security->encodeHTML('array2.'); // affects all items
|
||||
$this->assertEquals(Context::get('array2'), array('elem1'=>'One <ins>1</ins>','elem2'=>'Two <del>2</del>','elem3'=>'Three <addr>3</addr>'));
|
||||
|
|
@ -94,7 +99,7 @@ class OldSecurityTest extends \Codeception\TestCase\Test
|
|||
$security->encodeHTML('object1.prop3'); // affects only 'prop3' property
|
||||
$obj->prop3 = '<strong>Strong</strong> Baby';
|
||||
$this->assertEquals(Context::get('object1'), $obj);
|
||||
$this->_before(); // reset
|
||||
$this->_reset(); // reset
|
||||
$obj->prop3 = '<strong>Strong</strong> Baby';
|
||||
$this->assertEquals(Context::get('object1'), $obj);
|
||||
$security->encodeHTML('object1.'); // affects all properties
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue