]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - tests/service/Bug42683Test.php
Added unit tests.
[Github/sugarcrm.git] / tests / service / Bug42683Test.php
1 <?php
2 require_once 'tests/service/SOAPTestCase.php';
3
4 /**
5  * @ticket 42683
6  */
7 class Bug42683Test extends SOAPTestCase
8 {
9     public function setUp()
10     {
11         $this->_soapURL = $GLOBALS['sugar_config']['site_url'].'/service/v2/soap.php';
12                 parent::setUp();
13     }
14
15     public function testBadQuery() 
16     {
17         $lead = SugarTestLeadUtilities::createLead();
18         
19         $this->_login();
20         $result = $this->_soapClient->call(
21             'get_entry_list',
22             array(
23                 'session' => $this->_sessionId,
24                 "module_name" => 'Leads', 
25                 "query" => "leads.id = '{$lead->id}'",
26                 '',
27                 0,
28                 array(),
29                 array(array('name' =>  'email_addresses', 'value' => array('id', 'email_address', 'opt_out', 'primary_address'))),
30                 )
31             );
32                 
33         $this->assertEquals('primary_address', $result['relationship_list'][0][0]['records'][0][3]['name']);
34         
35         SugarTestLeadUtilities::removeAllCreatedLeads();
36     }
37 }