Merge branch 'develop' into pr/session-class

This commit is contained in:
Kijin Sung 2016-10-05 17:26:12 +09:00
commit a1618c236f
60 changed files with 1564 additions and 195 deletions

View file

@ -275,6 +275,31 @@ class TemplateHandlerTest extends \Codeception\TestCase\Test
array(
'<input>asdf src="../img/img.gif" asdf</input>',
'?><input>asdf src="../img/img.gif" asdf</input>'
),
// Rhymix improvements (PR #604)
array(
'<span>{$_SERVER["REMOTE_ADDR"]}</span>',
'?><span><?php echo $_SERVER["REMOTE_ADDR"] ?></span>'
),
array(
'<span>{escape($_COOKIE[$var], false)}</span>',
'?><span><?php echo escape($_COOKIE[$__Context->var], false) ?></span>'
),
array(
'<span>{$GLOBALS[$__Context->rhymix->rules]}</span>',
'?><span><?php echo $GLOBALS[$__Context->rhymix->rules] ?></span>'
),
array(
'<span>{$FOOBAR}</span>',
'?><span><?php echo $__Context->FOOBAR ?></span>'
),
array(
'<span>{RX_BASEDIR}</span>',
'?><span>{RX_BASEDIR}</span>'
),
array(
'<span>{\RX_BASEDIR}</span>',
'?><span><?php echo \RX_BASEDIR ?></span>'
),
);

View file

@ -5,8 +5,7 @@ class DebugTest extends \Codeception\TestCase\Test
public function testDebugEntry()
{
$file = __FILE__;
$line = __LINE__ + 2;
Rhymix\Framework\Debug::$write_to_error_log = false;
$line = __LINE__ + 1;
Rhymix\Framework\Debug::addEntry('foobar entry');
$entries = Rhymix\Framework\Debug::getEntries();
$this->assertEquals(1, count($entries));
@ -18,8 +17,7 @@ class DebugTest extends \Codeception\TestCase\Test
public function testDebugError()
{
$file = __FILE__;
$line = __LINE__ + 2;
Rhymix\Framework\Debug::$write_to_error_log = false;
$line = __LINE__ + 1;
Rhymix\Framework\Debug::addError(~0, 'Rhymix', $file, $line, null);
$errors = Rhymix\Framework\Debug::getErrors();
$this->assertGreaterThanOrEqual(1, count($errors));

View file

@ -108,7 +108,7 @@ class SecurityTest extends \Codeception\TestCase\Test
{
$_SERVER['REQUEST_METHOD'] = 'GET';
$_SERVER['HTTP_REFERER'] = '';
$this->assertFalse(Rhymix\Framework\Security::checkCSRF());
$this->assertTrue(Rhymix\Framework\Security::checkCSRF());
$_SERVER['REQUEST_METHOD'] = 'POST';
$this->assertTrue(Rhymix\Framework\Security::checkCSRF());