mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-12 23:14:18 +01:00
N°8148 - CAS problem when sending a link ending in &
- ApplicationContextTest mocking service
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace applicationContext;
|
||||
|
||||
/**
|
||||
* @covers ApplicationContext
|
||||
*/
|
||||
@@ -7,9 +9,10 @@ class ApplicationContextTest extends \Combodo\iTop\Test\UnitTest\ItopTestCase
|
||||
{
|
||||
public function testGetForLink()
|
||||
{
|
||||
$_REQUEST['c']['menu'] = 'TargetOverview';
|
||||
$_REQUEST['c']['org_id'] = '3';
|
||||
$oApplicationContext = new ApplicationContext(true);
|
||||
$oApplicationContext = new MockApplicationContext([
|
||||
'org_id' => '3',
|
||||
'menu' => 'TargetOverview',
|
||||
]);
|
||||
|
||||
$sExpected = '&c[org_id]=3&c[menu]=TargetOverview';
|
||||
$sActual = $oApplicationContext->GetForLink(true);
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace applicationContext;
|
||||
|
||||
class MockApplicationContext extends \ApplicationContext
|
||||
{
|
||||
|
||||
public function __construct(array $applicationContextConfig)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->aValues = $applicationContextConfig;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user