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/AOS_Invoices/AOS_InvoicesTest.php
j.dang 26ba455403 Replace explicit bean instantiations in files 161 - 170
- File: '... /tests/unit/phpunit/modules/Calls_Reschedule/Calls_RescheduleTest.php'

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

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

- File: '... /tests/unit/phpunit/modules/Relationships/RelationshipTest.php'

   - Replaced 12 occurrence(s) of 'new Relationship()'

- File: '... /tests/unit/phpunit/modules/OAuthTokens/OAuthTokenTest.php'

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

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

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

- File: '... /tests/unit/phpunit/modules/AOR_Reports/AOR_ReportTest.php'

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

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

- File: '... /tests/unit/phpunit/modules/Accounts/AccountTest.php'

   - Replaced 12 occurrence(s) of 'new Account()'

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

- File: '... /tests/unit/phpunit/modules/Schedulers/SchedulerTest.php'

   - Replaced 17 occurrence(s) of 'new Scheduler()'

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

- File: '... /tests/unit/phpunit/modules/jjwg_Maps/jjwg_MapsTest.php'

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

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

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

   - Replaced 15 occurrence(s) of 'new jjwg_Maps()'

- File: '... /tests/unit/phpunit/modules/AOS_Invoices/AOS_InvoicesTest.php'

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

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

- File: '... /tests/unit/phpunit/modules/Currencies/CurrencyTest.php'

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

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

- File: '... /tests/unit/phpunit/modules/SchedulersJobs/SchedulersJobTest.php'

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

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

49 lines
1.8 KiB
PHP

<?php
use SuiteCRM\Test\SuitePHPUnitFrameworkTestCase;
class AOS_InvoicesTest extends SuitePHPUnitFrameworkTestCase
{
public function setUp()
{
parent::setUp();
global $current_user;
get_sugar_config_defaults();
$current_user = BeanFactory::newBean('Users');
}
public function testAOS_Invoices()
{
// Execute the constructor and check for the Object type and attributes
$aosInvoices = BeanFactory::newBean('AOS_Invoices');
$this->assertInstanceOf('AOS_Invoices', $aosInvoices);
$this->assertInstanceOf('Basic', $aosInvoices);
$this->assertInstanceOf('SugarBean', $aosInvoices);
$this->assertAttributeEquals('AOS_Invoices', 'module_dir', $aosInvoices);
$this->assertAttributeEquals('AOS_Invoices', 'object_name', $aosInvoices);
$this->assertAttributeEquals('aos_invoices', 'table_name', $aosInvoices);
$this->assertAttributeEquals(true, 'new_schema', $aosInvoices);
$this->assertAttributeEquals(true, 'disable_row_level_security', $aosInvoices);
$this->assertAttributeEquals(true, 'importable', $aosInvoices);
}
public function testSaveAndMark_deleted()
{
$aosInvoices = BeanFactory::newBean('AOS_Invoices');
$aosInvoices->name = 'test';
$aosInvoices->save();
//test for record ID to verify that record is saved
$this->assertTrue(isset($aosInvoices->id));
$this->assertEquals(36, strlen($aosInvoices->id));
$this->assertGreaterThan(0, $aosInvoices->number);
//mark the record as deleted and verify that this record cannot be retrieved anymore.
$aosInvoices->mark_deleted($aosInvoices->id);
$result = $aosInvoices->retrieve($aosInvoices->id);
$this->assertEquals(null, $result);
}
}