mirror of
https://github.com/salesagility/SuiteCRM.git
synced 2025-02-21 20:56:08 +00:00

- File: '... /tests/unit/phpunit/modules/ACLActions/ACLActionTest.php' - Replaced 4 occurrence(s) of 'new ACLAction()' - Replaced 1 occurrence(s) of 'new User()' - File: '... /tests/unit/phpunit/modules/ProjectTask/ProjectTaskTest.php' - Replaced 19 occurrence(s) of 'new ProjectTask()' - Replaced 1 occurrence(s) of 'new User()' - File: '... /tests/unit/phpunit/modules/Alerts/AlertTest.php' - Replaced 1 occurrence(s) of 'new User()' - Replaced 2 occurrence(s) of 'new Alert()' - File: '... /tests/unit/phpunit/modules/ACLRoles/ACLRoleTest.php' - Replaced 10 occurrence(s) of 'new ACLRole()' - Replaced 1 occurrence(s) of 'new User()' - File: '... /tests/unit/phpunit/modules/jjwg_Markers/jjwg_MarkersTest.php' - Replaced 5 occurrence(s) of 'new jjwg_Markers()' - File: '... /tests/unit/phpunit/modules/Tasks/TaskTest.php' - Replaced 12 occurrence(s) of 'new Task()' - Replaced 1 occurrence(s) of 'new User()' - File: '... /tests/unit/phpunit/modules/CampaignLog/CampaignLogTest.php' - Replaced 4 occurrence(s) of 'new CampaignLog()' - Replaced 1 occurrence(s) of 'new User()' - File: '... /tests/unit/phpunit/modules/UserPreferences/UserPreferenceTest.php' - Replaced 5 occurrence(s) of 'new User()' - Replaced 2 occurrence(s) of 'new UserPreference()' - File: '... /tests/unit/phpunit/modules/Favorites/FavoritesTest.php' - Replaced 4 occurrence(s) of 'new Favorites()' - File: '... /tests/unit/phpunit/modules/AOR_Scheduled_Reports/AOR_Scheduled_ReportsTest.php' - Replaced 1 occurrence(s) of 'new User()' - Replaced 1 occurrence(s) of 'new AOR_Report()' - Replaced 5 occurrence(s) of 'new AOR_Scheduled_Reports()'
58 lines
2.2 KiB
PHP
58 lines
2.2 KiB
PHP
<?php
|
|
|
|
use SuiteCRM\Test\SuitePHPUnitFrameworkTestCase;
|
|
|
|
class CampaignLogTest extends SuitePHPUnitFrameworkTestCase
|
|
{
|
|
public function setUp()
|
|
{
|
|
parent::setUp();
|
|
|
|
global $current_user;
|
|
get_sugar_config_defaults();
|
|
$current_user = BeanFactory::newBean('Users');
|
|
}
|
|
|
|
public function testCampaignLog()
|
|
{
|
|
// Execute the constructor and check for the Object type and attributes
|
|
$campaignLog = BeanFactory::newBean('CampaignLog');
|
|
$this->assertInstanceOf('CampaignLog', $campaignLog);
|
|
$this->assertInstanceOf('SugarBean', $campaignLog);
|
|
|
|
$this->assertAttributeEquals('CampaignLog', 'module_dir', $campaignLog);
|
|
$this->assertAttributeEquals('CampaignLog', 'object_name', $campaignLog);
|
|
$this->assertAttributeEquals('campaign_log', 'table_name', $campaignLog);
|
|
$this->assertAttributeEquals(true, 'new_schema', $campaignLog);
|
|
}
|
|
|
|
public function testget_list_view_data()
|
|
{
|
|
$campaignLog = BeanFactory::newBean('CampaignLog');
|
|
|
|
//execute the method and verify it returns an array
|
|
$actual = $campaignLog->get_list_view_data();
|
|
$this->assertTrue(is_array($actual));
|
|
$this->assertSame(array(), $actual);
|
|
}
|
|
|
|
public function testretrieve_email_address()
|
|
{
|
|
$campaignLog = BeanFactory::newBean('CampaignLog');
|
|
$actual = $campaignLog->retrieve_email_address();
|
|
$this->assertGreaterThanOrEqual('', $actual);
|
|
}
|
|
|
|
public function testget_related_name()
|
|
{
|
|
$campaignLog = BeanFactory::newBean('CampaignLog');
|
|
|
|
//execute the method and verify that it retunrs expected results for all type parameters
|
|
$this->assertEquals('1Emails', $campaignLog->get_related_name(1, 'Emails'));
|
|
$this->assertEquals('1Contacts', $campaignLog->get_related_name(1, 'Contacts'));
|
|
$this->assertEquals('1Leads', $campaignLog->get_related_name(1, 'Leads'));
|
|
$this->assertEquals('1Prospects', $campaignLog->get_related_name(1, 'Prospects'));
|
|
$this->assertEquals('1CampaignTrackers', $campaignLog->get_related_name(1, 'CampaignTrackers'));
|
|
$this->assertEquals('1Accounts', $campaignLog->get_related_name(1, 'Accounts'));
|
|
}
|
|
}
|