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

- File: '... /tests/unit/phpunit/modules/AOS_Quotes/AOS_QuotesTest.php' - Replaced 1 occurrence(s) of 'new User()' - Replaced 2 occurrence(s) of 'new AOS_Quotes()' - File: '... /tests/unit/phpunit/modules/AOW_Processed/AOW_ProcessedTest.php' - Replaced 1 occurrence(s) of 'new User()' - Replaced 2 occurrence(s) of 'new AOW_Processed()' - File: '... /tests/unit/phpunit/modules/Releases/ReleaseTest.php' - Replaced 7 occurrence(s) of 'new Release()' - File: '... /tests/unit/phpunit/modules/Administration/AdministrationTest.php' - Replaced 1 occurrence(s) of 'new User()' - Replaced 6 occurrence(s) of 'new Administration()' - File: '... /tests/unit/phpunit/modules/EmailText/EmailTextTest.php' - Replaced 1 occurrence(s) of 'new EmailText()' - File: '... /tests/unit/phpunit/modules/Prospects/ProspectTest.php' - Replaced 9 occurrence(s) of 'new Prospect()' - Replaced 1 occurrence(s) of 'new User()' - File: '... /tests/unit/phpunit/modules/InboundEmail/InboundEmailTest.php' - Replaced 1 occurrence(s) of 'new aCase()' - Replaced 1 occurrence(s) of 'new Note()' - Replaced 7 occurrence(s) of 'new Email()' - Replaced 3 occurrence(s) of 'new User()' - Replaced 154 occurrence(s) of 'new InboundEmail()' - File: '... /tests/unit/phpunit/modules/vCals/vCalTest.php' - Replaced 1 occurrence(s) of 'new Meeting()' - Replaced 1 occurrence(s) of 'new User()' - Replaced 10 occurrence(s) of 'new vCal()' - File: '... /tests/unit/phpunit/modules/AOS_Products_Quotes/AOS_Products_QuotesTest.php' - Replaced 1 occurrence(s) of 'new User()' - Replaced 4 occurrence(s) of 'new AOS_Products_Quotes()' - Replaced 3 occurrence(s) of 'new AOS_Quotes()' - File: '... /tests/unit/phpunit/modules/AOK_KnowledgeBase/AOK_KnowledgeBaseTest.php' - Replaced 1 occurrence(s) of 'new AOK_KnowledgeBase()'
52 lines
1.8 KiB
PHP
52 lines
1.8 KiB
PHP
<?php
|
|
|
|
use SuiteCRM\Test\SuitePHPUnitFrameworkTestCase;
|
|
|
|
class AOS_QuotesTest extends SuitePHPUnitFrameworkTestCase
|
|
{
|
|
public function setUp()
|
|
{
|
|
parent::setUp();
|
|
|
|
global $current_user;
|
|
get_sugar_config_defaults();
|
|
$current_user = BeanFactory::newBean('Users');
|
|
}
|
|
|
|
public function testAOS_Quotes()
|
|
{
|
|
// Execute the constructor and check for the Object type and attributes
|
|
$aosQuotes = BeanFactory::newBean('AOS_Quotes');
|
|
$this->assertInstanceOf('AOS_Quotes', $aosQuotes);
|
|
$this->assertInstanceOf('Basic', $aosQuotes);
|
|
$this->assertInstanceOf('SugarBean', $aosQuotes);
|
|
|
|
$this->assertAttributeEquals('AOS_Quotes', 'module_dir', $aosQuotes);
|
|
$this->assertAttributeEquals('AOS_Quotes', 'object_name', $aosQuotes);
|
|
$this->assertAttributeEquals('aos_quotes', 'table_name', $aosQuotes);
|
|
$this->assertAttributeEquals(true, 'new_schema', $aosQuotes);
|
|
$this->assertAttributeEquals(true, 'disable_row_level_security', $aosQuotes);
|
|
$this->assertAttributeEquals(true, 'importable', $aosQuotes);
|
|
$this->assertAttributeEquals(true, 'lineItems', $aosQuotes);
|
|
}
|
|
|
|
public function testSaveAndMark_deleted()
|
|
{
|
|
$aosQuotes = BeanFactory::newBean('AOS_Quotes');
|
|
|
|
$aosQuotes->name = 'test';
|
|
$aosQuotes->total_amt = 100;
|
|
$aosQuotes->total_amt_usdollar = 100;
|
|
|
|
$aosQuotes->save();
|
|
|
|
//test for record ID to verify that record is saved
|
|
$this->assertTrue(isset($aosQuotes->id));
|
|
$this->assertEquals(36, strlen($aosQuotes->id));
|
|
|
|
//mark the record as deleted and verify that this record cannot be retrieved anymore.
|
|
$aosQuotes->mark_deleted($aosQuotes->id);
|
|
$result = $aosQuotes->retrieve($aosQuotes->id);
|
|
$this->assertEquals(null, $result);
|
|
}
|
|
}
|