0
0
Fork 0
mirror of https://github.com/salesagility/SuiteCRM.git synced 2025-02-21 20:56:08 +00:00
salesagility_SuiteCRM/tests/unit/phpunit/modules/EmailAddresses/EmailAddressTest.php
j.dang cfa1f7cc28 Replace explicit bean instantiations in files 151 - 160
- File: '... /tests/unit/phpunit/modules/Groups/GroupTest.php'

   - Replaced 3 occurrence(s) of 'new Group()'

   - Replaced 1 occurrence(s) of 'new User()'

- File: '... /tests/unit/phpunit/modules/AOS_Product_Categories/AOS_Product_CategoriesTest.php'

   - Replaced 1 occurrence(s) of 'new User()'

   - Replaced 2 occurrence(s) of 'new AOS_Product_Categories()'

- File: '... /tests/unit/phpunit/modules/AOD_IndexEvent/AOD_IndexEventTest.php'

   - Replaced 1 occurrence(s) of 'new AOD_IndexEvent()'

- File: '... /tests/unit/phpunit/modules/AOP_Case_Updates/AOP_Case_UpdatesTest.php'

   - Replaced 1 occurrence(s) of 'new User()'

   - Replaced 7 occurrence(s) of 'new AOP_Case_Updates()'

- File: '... /tests/unit/phpunit/modules/Campaigns/CampaignTest.php'

   - Replaced 1 occurrence(s) of 'new Lead()'

   - Replaced 3 occurrence(s) of 'new ProspectList()'

   - Replaced 20 occurrence(s) of 'new Campaign()'

   - Replaced 1 occurrence(s) of 'new User()'

- File: '... /tests/unit/phpunit/modules/DocumentRevisions/DocumentRevisionTest.php'

   - Replaced 1 occurrence(s) of 'new User()'

   - Replaced 13 occurrence(s) of 'new DocumentRevision()'

- File: '... /tests/unit/phpunit/modules/AOW_WorkFlow/AOW_WorkFlowTest.php'

   - Replaced 4 occurrence(s) of 'new Call()'

   - Replaced 1 occurrence(s) of 'new User()'

   - Replaced 3 occurrence(s) of 'new AOS_Quotes()'

   - Replaced 16 occurrence(s) of 'new AOW_WorkFlow()'

   - Replaced 1 occurrence(s) of 'new AOW_Processed()'

   - Replaced 2 occurrence(s) of 'new AOW_Condition()'

- File: '... /tests/unit/phpunit/modules/EmailAddresses/EmailAddressTest.php'

   - Replaced 2 occurrence(s) of 'new EmailAddress()'

- File: '... /tests/unit/phpunit/modules/AOW_Conditions/AOW_ConditionTest.php'

   - Replaced 1 occurrence(s) of 'new User()'

   - Replaced 1 occurrence(s) of 'new AOW_WorkFlow()'

   - Replaced 3 occurrence(s) of 'new AOW_Condition()'

- File: '... /tests/unit/phpunit/modules/Calls/CallTest.php'

   - Replaced 18 occurrence(s) of 'new Call()'

   - Replaced 2 occurrence(s) of 'new User()'
2020-01-22 13:51:02 +00:00

41 lines
1.4 KiB
PHP

<?php
use SuiteCRM\Test\SuitePHPUnitFrameworkTestCase;
class EmailAddressTest extends SuitePHPUnitFrameworkTestCase
{
public function testEmailAddress()
{
// Execute the constructor and check for the Object type and attributes
$email = BeanFactory::newBean('EmailAddresses');
$this->assertInstanceOf('EmailAddress', $email);
$this->assertInstanceOf('SugarEmailAddress', $email);
$this->assertInstanceOf('SugarBean', $email);
$this->assertAttributeEquals('EmailAddresses', 'module_dir', $email);
$this->assertAttributeEquals('EmailAddresses', 'module_name', $email);
$this->assertAttributeEquals('EmailAddress', 'object_name', $email);
$this->assertAttributeEquals('email_addresses', 'table_name', $email);
$this->assertAttributeEquals(true, 'disable_row_level_security', $email);
}
public function testsave()
{
$email = BeanFactory::newBean('EmailAddresses');
$email->email_address = 'test@test.com';
$email->invaid_email = 0;
$email->save();
//test for record ID to verify that record is saved
$this->assertTrue(isset($email->id));
$this->assertEquals(36, strlen($email->id));
//mark the record as deleted and verify that this record cannot be retrieved anymore.
$email->mark_deleted($email->id);
$result = $email->retrieve($email->id);
$this->assertEquals(null, $result);
}
}