mirror of
https://github.com/salesagility/SuiteCRM.git
synced 2025-02-22 21:18:38 +00:00
43 lines
1.1 KiB
PHP
43 lines
1.1 KiB
PHP
<?php
|
|
|
|
use SuiteCRM\Test\SuitePHPUnitFrameworkTestCase;
|
|
|
|
class ViewQuickeditTest extends SuitePHPUnitFrameworkTestCase
|
|
{
|
|
public function setUp()
|
|
{
|
|
parent::setUp();
|
|
}
|
|
|
|
public function testpreDisplay()
|
|
{
|
|
if (isset($_REQUEST)) {
|
|
$_request = $_REQUEST;
|
|
}
|
|
|
|
//check without setting any values, it should execute without any issues.
|
|
$view = new ViewQuickedit();
|
|
$view->preDisplay();
|
|
$this->assertEquals(0, count($_REQUEST));
|
|
|
|
//check with values preset but without a valid bean id, it sould not change Request parameters
|
|
$_REQUEST['source_module'] = 'Users';
|
|
$_REQUEST['module'] = 'Users';
|
|
$_REQUEST['record'] = '';
|
|
$request = $_REQUEST;
|
|
|
|
$view->preDisplay();
|
|
$this->assertSame($request, $_REQUEST);
|
|
|
|
//check with values preset, it sould set some addiiotnal Request parameters
|
|
$_REQUEST['record'] = 1;
|
|
$view->preDisplay();
|
|
$this->assertNotSame($request, $_REQUEST);
|
|
|
|
if (isset($_request)) {
|
|
$_REQUEST = $_request;
|
|
} else {
|
|
unset($_REQUEST);
|
|
}
|
|
}
|
|
}
|