X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=tests%2Fphpunit%2FCRM%2FContact%2FBAO%2FGroupContactCacheTest.php;h=76561d3ede34b84b8b2bfc900bdf4681529053b7;hb=92915c5561d7ef4742bd6b46237760d6209141de;hp=7ad12dcd77d1708cb741772525ee581a1a6b5977;hpb=d69fa047cdc76b337124f93354abb2e1bf207a58;p=civicrm-core.git diff --git a/tests/phpunit/CRM/Contact/BAO/GroupContactCacheTest.php b/tests/phpunit/CRM/Contact/BAO/GroupContactCacheTest.php index 7ad12dcd77..76561d3ede 100644 --- a/tests/phpunit/CRM/Contact/BAO/GroupContactCacheTest.php +++ b/tests/phpunit/CRM/Contact/BAO/GroupContactCacheTest.php @@ -1,7 +1,7 @@ 'Deceased Contacts', @@ -86,7 +86,11 @@ class CRM_Contact_BAO_GroupContactCacheTest extends CiviUnitTestCase { $this->assertAPISuccess($result); CRM_Contact_BAO_GroupContactCache::load($group, TRUE); $this->assertCacheMatches( - array(/* deceased[0], */ $deceased[1]->id, $deceased[2]->id, $living[0]->id), + array(/* deceased[0], */ + $deceased[1]->id, + $deceased[2]->id, + $living[0]->id + ), $group->id ); } @@ -95,7 +99,7 @@ class CRM_Contact_BAO_GroupContactCacheTest extends CiviUnitTestCase { * Allow removing contact from a parent group even if contact is in * a child group. (CRM-8858) */ - function testRemoveFromParentSmartGroup() { + public function testRemoveFromParentSmartGroup() { // Create smart group $parent $params = array( 'name' => 'Deceased Contacts', @@ -146,7 +150,10 @@ class CRM_Contact_BAO_GroupContactCacheTest extends CiviUnitTestCase { // Assert $c1 not in $parent CRM_Contact_BAO_GroupContactCache::load($parent, TRUE); $this->assertCacheMatches( - array( /* deceased[0], */ $deceased[1]->id, $deceased[2]->id), + array(/* deceased[0], */ + $deceased[1]->id, + $deceased[2]->id + ), $parent->id ); @@ -164,10 +171,11 @@ class CRM_Contact_BAO_GroupContactCacheTest extends CiviUnitTestCase { /** * Assert that the cache for a group contains exactly the listed contacts * - * @param $expectedContactIds array(int) - * @param $groupId int + * @param array $expectedContactIds + * Array(int). + * @param int $groupId */ - function assertCacheMatches($expectedContactIds, $groupId) { + public function assertCacheMatches($expectedContactIds, $groupId) { $sql = 'SELECT contact_id FROM civicrm_group_contact_cache WHERE group_id = %1'; $params = array(1 => array($groupId, 'Integer')); $dao = CRM_Core_DAO::executeQuery($sql, $params); @@ -191,8 +199,6 @@ class CRM_Contact_BAO_GroupContactCacheTest extends CiviUnitTestCase { /** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. - * - * @access protected */ protected function setUp() { $this->_testObjects = array(); @@ -202,8 +208,6 @@ class CRM_Contact_BAO_GroupContactCacheTest extends CiviUnitTestCase { /** * Tears down the fixture, for example, closes a network connection. * This method is called after a test is executed. - * - * @access protected */ protected function tearDown() { parent::tearDown(); @@ -216,21 +220,22 @@ class CRM_Contact_BAO_GroupContactCacheTest extends CiviUnitTestCase { * * @see CRM_Core_DAO::createTestObject */ - function createTestObject($daoName, $params = array( - ), $numObjects = 1, $createOnly = FALSE) { + function createTestObject($daoName, $params = array(), $numObjects = 1, $createOnly = FALSE) { $objects = CRM_Core_DAO::createTestObject($daoName, $params, $numObjects, $createOnly); if (is_array($objects)) { $this->registerTestObjects($objects); - } else { + } + else { $this->registerTestObjects(array($objects)); } return $objects; } /** - * @param $objects array DAO or BAO objects + * @param array $objects + * DAO or BAO objects. */ - function registerTestObjects($objects) { + public function registerTestObjects($objects) { //if (is_object($objects)) { // $objects = array($objects); //} @@ -240,7 +245,7 @@ class CRM_Contact_BAO_GroupContactCacheTest extends CiviUnitTestCase { } } - function deleteTestObjects() { + public function deleteTestObjects() { // Note: You might argue that the FK relations between test // objects could make this problematic; however, it should // behave intuitively as long as we mentally split our