Report TestCaseTest DetailTest Fix

Fixes contain the test fixes for
CRM_Report_Form_Contribute_DetailTest::testReportOutput
CRM_Report_Form_TestCaseTest::testBadReportOutput
After fixing the sql file, the tests was breaking at the point where userFrameworkURLVar('q') was undefined in CRM/Core/Controller.php file, So I used the isset function to enter the loop whenever the variable is defined.