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()'
40 lines
1.4 KiB
PHP
40 lines
1.4 KiB
PHP
<?php
|
|
|
|
use SuiteCRM\Test\SuitePHPUnitFrameworkTestCase;
|
|
|
|
class AlertTest extends SuitePHPUnitFrameworkTestCase
|
|
{
|
|
public function setUp()
|
|
{
|
|
parent::setUp();
|
|
|
|
global $current_user;
|
|
get_sugar_config_defaults();
|
|
$current_user = BeanFactory::newBean('Users');
|
|
}
|
|
|
|
public function testAlert()
|
|
{
|
|
// Execute the constructor and check for the Object type and type attribute
|
|
$alert = BeanFactory::newBean('Alerts');
|
|
$this->assertInstanceOf('Alert', $alert);
|
|
$this->assertInstanceOf('Basic', $alert);
|
|
$this->assertInstanceOf('SugarBean', $alert);
|
|
|
|
$this->assertAttributeEquals('Alerts', 'module_dir', $alert);
|
|
$this->assertAttributeEquals('Alert', 'object_name', $alert);
|
|
$this->assertAttributeEquals('alerts', 'table_name', $alert);
|
|
$this->assertAttributeEquals(true, 'new_schema', $alert);
|
|
$this->assertAttributeEquals(true, 'disable_row_level_security', $alert);
|
|
$this->assertAttributeEquals(false, 'importable', $alert);
|
|
}
|
|
|
|
public function testbean_implements()
|
|
{
|
|
$alert = BeanFactory::newBean('Alerts');
|
|
|
|
$this->assertEquals(false, $alert->bean_implements('')); //test with empty value
|
|
$this->assertEquals(false, $alert->bean_implements('test')); //test with invalid value
|
|
$this->assertEquals(true, $alert->bean_implements('ACL')); //test with valid value
|
|
}
|
|
}
|