for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
class ViewSugarpdfTest extends PHPUnit_Framework_TestCase{
You can fix this by adding a namespace to your class:
namespace YourVendor; class YourClass { }
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.
function testViewSugarpdf(){
error_reporting(E_ERROR | E_WARNING | E_PARSE);
//execute the method without request parameters and test if it works. it should output some headers and throw headers output exception.
try {
$view = new ViewSugarpdf();
} catch (Exception $e) {
$this->assertStringStartsWith('Cannot modify header information',$e->getMessage());
}
$this->assertEquals(Null,$view);
//execute the method with request parameters and test if it works.
$_REQUEST["sugarpdf"] = 'someValue';
$view->module = "Users";
$this->assertInstanceOf('ViewSugarpdf',$view);
$this->assertInstanceOf('SugarView',$view);
$this->assertAttributeEquals('sugarpdf','type', $view);
$this->assertAttributeEquals('someValue','sugarpdf', $view);
$this->assertAttributeEquals(NULL,'sugarpdfBean', $view);
//Incomplete test. SugarpdfFactory::loadSugarpdf throws fatal error. error needs to be resolved before testing.
function testpreDisplay(){
$this->markTestIncomplete('Can Not be implemented');
function testdisplay(){
?>
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.