0
0
mirror of https://github.com/salesagility/SuiteCRM.git synced 2024-12-23 04:48:03 +00:00
salesagility_SuiteCRM/tests/unit/phpunit/modules/AOR_Conditions/AOR_ConditionTest.php
Dillon-Brown 26aab7535d Move test namespaces into autoload-dev
Signed-off-by: Dillon-Brown <dillon.brown@salesagility.com>
2021-09-08 16:49:16 +01:00

46 lines
1.8 KiB
PHP

<?php
use SuiteCRM\Test\SuitePHPUnitFrameworkTestCase;
class AOR_ConditionTest extends SuitePHPUnitFrameworkTestCase
{
public function testAOR_Condition(): void
{
// Execute the constructor and check for the Object type and attributes
$aor_Condition = BeanFactory::newBean('AOR_Conditions');
self::assertInstanceOf('AOR_Condition', $aor_Condition);
self::assertInstanceOf('Basic', $aor_Condition);
self::assertInstanceOf('SugarBean', $aor_Condition);
self::assertEquals('AOR_Conditions', $aor_Condition->module_dir);
self::assertEquals('AOR_Condition', $aor_Condition->object_name);
self::assertEquals('aor_conditions', $aor_Condition->table_name);
self::assertEquals(true, $aor_Condition->new_schema);
self::assertEquals(true, $aor_Condition->disable_row_level_security);
self::assertEquals(true, $aor_Condition->importable);
self::assertEquals(false, $aor_Condition->tracker_visibility);
}
public function testsave_lines(): void
{
$aor_Condition = BeanFactory::newBean('AOR_Conditions');
//preset the required data
$post_data = array();
$post_data['field'][] = 'test field';
$post_data['name'][] = 'test';
$post_data['parameter'][] = '1';
$post_data['module_path'][] = 'test path';
$post_data['operator'][] = 'test';
$post_data['value_type'][] = 'test type';
// Execute the method and test that it works and doesn't throw an exception.
try {
$aor_Condition->save_lines($post_data, BeanFactory::newBean('AOR_Reports'));
self::assertTrue(true);
} catch (Exception $e) {
self::fail($e->getMessage() . "\nTrace:\n" . $e->getTraceAsString());
}
}
}