Test Failed
Push — 135-map-multiple-wordpress-obj... ( 3634c2...bb35fb )
by Jonathan
12:00
created

Lib_Test_Enterprise_AllowFieldTruncationHeaderTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 29
rs 10
c 0
b 0
f 0
wmc 2
lcom 1
cbo 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getTestName() 0 4 1
A _run() 0 21 1
1
<?php
2
/**
3
 */
4
class Lib_Test_Enterprise_AllowFieldTruncationHeaderTest extends Lib_Test_TestAbstractEnterprise
5
{
6
	public function getTestName()
0 ignored issues
show
Coding Style introduced by
The function name getTestName is in camel caps, but expected get_test_name instead as per the coding standard.
Loading history...
7
	{
8
		return 'AllowFieldTruncationHeader';
9
	}
10
	
11
	protected function _run()
12
	{
13
	    $header = new AllowFieldTruncationHeader(true);
14
	    print_r($header);
0 ignored issues
show
introduced by
The use of function print_r() is discouraged
Loading history...
15
	    $this->_mySforceConnection->setAllowFieldTruncationHeader($header);
16
	    
17
	    $sObject = new stdclass();
18
		$sObject->FirstName = 'Smith';
19
		$sObject->LastName = 'John';
20
		$sObject->Phone = '510-555-55551111111111111111111111111111111111111111111111111111111111111111111';
21
		$sObject->BirthDate = '1927-01-25';
22
		
23
		echo "**** Creating the following:\r\n";
24
		print_r($this->_mySforceConnection->create(array($sObject), 'Contact'));
0 ignored issues
show
Unused Code introduced by
The call to SforcePartnerClient::create() has too many arguments starting with 'Contact'.

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
introduced by
The use of function print_r() is discouraged
Loading history...
introduced by
No space after opening parenthesis of array is bad style
Loading history...
introduced by
No space before closing parenthesis of array is bad style
Loading history...
25
		
0 ignored issues
show
Coding Style introduced by
Functions must not contain multiple empty lines in a row; found 2 empty lines
Loading history...
26
		
27
		print "**** LastRequestHeaders:\r\n";
28
	    print_r($this->_mySforceConnection->getLastRequestHeaders());
0 ignored issues
show
introduced by
The use of function print_r() is discouraged
Loading history...
29
	    print "**** LastRequest:\r\n";
30
	    print_r($this->_mySforceConnection->getLastRequest());
0 ignored issues
show
introduced by
The use of function print_r() is discouraged
Loading history...
31
	}
32
}