mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 02:28:44 +02:00
N°8148 - CAS problem when sending a link ending in & (#722)
N°8148 - CAS problem when sending a link ending in &
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @covers ApplicationContext
|
||||
*/
|
||||
class ApplicationContextTest extends \Combodo\iTop\Test\UnitTest\ItopTestCase
|
||||
{
|
||||
public function testGetForLink()
|
||||
{
|
||||
$_REQUEST['c']['menu'] = 'TargetOverview';
|
||||
$_REQUEST['c']['org_id'] = '3';
|
||||
$oApplicationContext = new ApplicationContext(true);
|
||||
|
||||
$sExpected = '&c[org_id]=3&c[menu]=TargetOverview';
|
||||
$sActual = $oApplicationContext->GetForLink(true);
|
||||
$this->assertEquals($sExpected, $sActual, 'Query parameters string should include all request parameters prefixed with &');
|
||||
|
||||
$sExpected = 'c[org_id]=3&c[menu]=TargetOverview';
|
||||
$sActual = $oApplicationContext->GetForLink();
|
||||
$this->assertEquals($sExpected, $sActual, 'Query parameters string should not start with & when $bIncludeAmpersand is false');
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user