0
0
Fork 0
mirror of https://github.com/salesagility/SuiteCRM.git synced 2025-03-17 23:02:43 +00:00

fixing popup tests, quick create tests

This commit is contained in:
Gyula Madarasz 2018-03-29 17:05:49 +01:00
parent 684d6ee522
commit 4b3d9f79b8
2 changed files with 36 additions and 0 deletions
tests/unit/include/MVC/View/views

View file

@ -43,6 +43,7 @@ class ViewPopupTest extends SuiteCRM\StateChecker_PHPUnit_Framework_TestCase
self::assertTrue(true);
}
// clean up
if(isset($session)) {
$_SESSION = $session;

View file

@ -13,6 +13,10 @@ class ViewQuickcreateTest extends SuiteCRM\StateChecker_PHPUnit_Framework_TestCa
public function testpreDisplay()
{
if(isset($_REQUEST)) {
$_request = $_REQUEST;
}
//check without setting any values, it should execute without any issues.
$view = new ViewQuickcreate();
@ -32,10 +36,27 @@ class ViewQuickcreateTest extends SuiteCRM\StateChecker_PHPUnit_Framework_TestCa
$_REQUEST['record'] = 1;
$view->preDisplay();
$this->assertNotSame($request, $_REQUEST);
// clean up
if(isset($_request)) {
$_REQUEST = $_request;
} else {
unset($_REQUEST);
}
}
public function testdisplay()
{
if(isset($_SESSION)) {
$_session = $_SESSION;
}
if(isset($_REQUEST)) {
$_request = $_REQUEST;
}
error_reporting(E_ERROR | E_PARSE);
//execute the method with required child objects and parameters preset. it will return some html.
@ -53,5 +74,19 @@ class ViewQuickcreateTest extends SuiteCRM\StateChecker_PHPUnit_Framework_TestCa
$this->assertGreaterThan(0, strlen($renderedContent));
$this->assertEquals(false, json_decode($renderedContent)); //check that it doesn't return json.
// clean up
if(isset($_session)) {
$_SESSION = $_session;
} else {
unset($_SESSION);
}
if(isset($_request)) {
$_REQUEST = $_request;
} else {
unset($_REQUEST);
}
}
}