예제 #1
0
 function testGetReferencesToTable()
 {
     $refs = CRM_Core_DAO::getReferencesToTable(CRM_Financial_DAO_FinancialType::getTableName());
     $refsBySource = array();
     foreach ($refs as $refSpec) {
         $refsBySource[$refSpec->getReferenceTable()] = $refSpec;
     }
     $this->assertTrue(array_key_exists('civicrm_entity_financial_account', $refsBySource));
     $genericRef = $refsBySource['civicrm_entity_financial_account'];
     $this->assertEquals('entity_id', $genericRef->getReferenceKey());
     $this->assertEquals('entity_table', $genericRef->getTypeColumn());
     $this->assertEquals('id', $genericRef->getTargetKey());
     $this->assertEquals(TRUE, $genericRef->isGeneric());
 }