Based on a quick grep, these files had a lot of `list()` statements, so I let PHPStorm clean them up.
'expected_contact' => [$this->_contactID],
];
$query = new CRM_Contact_BAO_Query(CRM_Contact_BAO_Query::convertFormValues($case['form_value']));
- list($select, $from, $where, $having) = $query->query();
+ [$select, $from, $where, $having] = $query->query();
$groupContacts = CRM_Core_DAO::executeQuery("SELECT DISTINCT contact_a.id $from $where")->fetchAll();
foreach ($groupContacts as $key => $value) {
$groupContacts[$key] = $value['id'];
'expected_contact' => [$this->_contactID],
];
$query = new CRM_Contact_BAO_Query(CRM_Contact_BAO_Query::convertFormValues($case['form_value']));
- list($select, $from, $where, $having) = $query->query();
+ [$select, $from, $where, $having] = $query->query();
$groupContacts = CRM_Core_DAO::executeQuery("SELECT DISTINCT contact_a.id $from $where")->fetchAll();
foreach ($groupContacts as $key => $value) {
$groupContacts[$key] = $value['id'];
'expected_contact' => [$this->_contactID],
];
$query = new CRM_Contact_BAO_Query(CRM_Contact_BAO_Query::convertFormValues($case['form_value']));
- list($select, $from, $where, $having) = $query->query();
+ [$select, $from, $where, $having] = $query->query();
$groupContacts = CRM_Core_DAO::executeQuery("SELECT DISTINCT contact_a.id $from $where")->fetchAll();
foreach ($groupContacts as $key => $value) {
$groupContacts[$key] = $value['id'];
'expected_contact' => [$this->_contactID],
];
$query = new CRM_Contact_BAO_Query(CRM_Contact_BAO_Query::convertFormValues($case['form_value']));
- list($select, $from, $where, $having) = $query->query();
+ [$select, $from, $where, $having] = $query->query();
$groupContacts = CRM_Core_DAO::executeQuery("SELECT DISTINCT contact_a.id $from $where")->fetchAll();
foreach ($groupContacts as $key => $value) {
$groupContacts[$key] = $value['id'];
'expected_contact' => [$this->_contactID],
];
$query = new CRM_Contact_BAO_Query(CRM_Contact_BAO_Query::convertFormValues($case['form_value']));
- list($select, $from, $where, $having) = $query->query();
+ [$select, $from, $where, $having] = $query->query();
$expectedQill = [
0 => [
'expected_contact' => [$this->_contactID],
];
$query = new CRM_Contact_BAO_Query(CRM_Contact_BAO_Query::convertFormValues($case['form_value']));
- list($select, $from, $where, $having) = $query->query();
+ [$select, $from, $where, $having] = $query->query();
$expectedQill = [
0 => [
$queryObj = new CRM_Contact_BAO_Query($params, $returnProperties);
try {
$this->assertLike($expectedSQL, $queryObj->getSearchSQL());
- list($select, $from, $where, $having) = $queryObj->query();
+ [$select, $from, $where, $having] = $queryObj->query();
$dao = CRM_Core_DAO::executeQuery("$select $from $where $having");
$dao->fetch();
$this->assertEquals('Anderson, Anthony', $dao->sort_name);
TRUE, FALSE
);
- list($select) = $query->query();
+ [$select] = $query->query();
$this->assertEquals('SELECT contact_a.id as contact_id', $select);
}
TRUE, FALSE
);
- list($select, $from, $where, $having) = $query->query();
+ [$select, $from, $where, $having] = $query->query();
$this->assertEquals($expectedWhere, $where);
}
],
];
$query = new CRM_Contact_BAO_Query($params);
- list($select, $from, $where) = $query->query();
+ [$select, $from, $where] = $query->query();
$this->assertStringContainsString("contact_a.sort_name LIKE '%John%Doe%'", $where);
//Check for NO wildcard due to comma
$params[0][2] = 'Doe, John';
$query = new CRM_Contact_BAO_Query($params);
- list($select, $from, $where) = $query->query();
+ [$select, $from, $where] = $query->query();
$this->assertStringContainsString("contact_a.sort_name LIKE '%Doe, John%'", $where);
}
foreach ($entities['values'] as $value) {
$ids[] = $value['entity_id'];
}
- list($batchContriID1, $batchContriID2) = $ids;
+ [$batchContriID1, $batchContriID2] = $ids;
$useCases = [
// Case 1: Search for ONLY those contributions which are created from batch
$fv = $case['form_value'];
CRM_Contact_BAO_Query::processSpecialFormValue($fv, ['contribution_batch_id']);
$query = new CRM_Contact_BAO_Query(CRM_Contact_BAO_Query::convertFormValues($fv));
- list($select, $from, $where) = $query->query();
+ [$select, $from, $where] = $query->query();
// get and assert contribution count
$contributions = CRM_Core_DAO::executeQuery(sprintf('SELECT DISTINCT civicrm_contribution.id %s %s AND civicrm_contribution.id IS NOT NULL', $from, $where))->fetchAll();
$fv = $case['form_value'];
CRM_Contact_BAO_Query::processSpecialFormValue($fv, ['financial_trxn_card_type_id']);
$query = new CRM_Contact_BAO_Query(CRM_Contact_BAO_Query::convertFormValues($fv));
- list($select, $from, $where) = $query->query();
+ [$select, $from, $where] = $query->query();
// get and assert contribution count
$contributions = CRM_Core_DAO::executeQuery(sprintf('SELECT DISTINCT civicrm_contribution.id %s %s AND civicrm_contribution.id IS NOT NULL', $from, $where))->fetchAll();
$fv = $case['form_value'];
CRM_Contact_BAO_Query::processSpecialFormValue($fv, ['financial_trxn_pan_truncation']);
$query = new CRM_Contact_BAO_Query(CRM_Contact_BAO_Query::convertFormValues($fv));
- list($select, $from, $where) = $query->query();
+ [$select, $from, $where] = $query->query();
// get and assert contribution count
$contributions = CRM_Core_DAO::executeQuery(sprintf('SELECT DISTINCT civicrm_contribution.id %s %s AND civicrm_contribution.id IS NOT NULL', $from, $where))->fetchAll();
$fv = ['contact_id' => $contactID];
$queryParams = CRM_Contact_BAO_Query::convertFormValues($fv);
$selector = new CRM_Contribute_Selector_Search($queryParams, CRM_Core_Action::ADD);
- list($select, $from, $where) = $selector->getQuery()->query();
+ [$select, $from, $where] = $selector->getQuery()->query();
// get and assert contribution count
$contributions = CRM_Core_DAO::executeQuery("{$select} {$from} {$where}")->fetchAll();
'contact_id' => $contactID,
]);
$selector = new CRM_Contribute_Selector_Search($queryParams, CRM_Core_Action::ADD);
- list($select, $from, $where) = $selector->getQuery()->query();
+ [$select, $from, $where] = $selector->getQuery()->query();
// get and assert contribution count
$contributions = CRM_Core_DAO::executeQuery("{$select} {$from} {$where}")->fetchAll();
$this->setUpRecurringContributions();
$query = new CRM_Contact_BAO_Query(CRM_Contact_BAO_Query::convertFormValues($formValues));
- list($select, $from, $where, $having) = $query->query();
+ [$select, $from, $where, $having] = $query->query();
// get and assert contribution count
$contacts = CRM_Core_DAO::executeQuery(sprintf('SELECT DISTINCT contact_a.id, contact_a.display_name %s %s AND contact_a.id IS NOT NULL', $from, $where))->fetchAll();
$fv = $case['form_value'];
CRM_Contact_BAO_Query::processSpecialFormValue($fv, ['cancel_reason']);
$query = new CRM_Contact_BAO_Query(CRM_Contact_BAO_Query::convertFormValues($fv));
- list($select, $from, $where) = $query->query();
+ [$select, $from, $where] = $query->query();
// get and assert contribution count
$contributions = CRM_Core_DAO::executeQuery(sprintf('SELECT DISTINCT civicrm_contribution.id %s %s AND civicrm_contribution.id IS NOT NULL AND civicrm_contribution.contribution_status_id = 3', $from, $where))->fetchAll();
}
public function testGetKeys() {
- list($basedir, $c) = $this->_createContainer();
+ [$basedir, $c] = $this->_createContainer();
$this->assertEquals($c->getKeys(), ['test.foo', 'test.foo.bar']);
}
public function testGetPath() {
- list($basedir, $c) = $this->_createContainer();
+ [$basedir, $c] = $this->_createContainer();
try {
$c->getPath('un.kno.wn');
}
}
public function testGetPath_extraSlashFromConfig() {
- list($basedir, $c) = $this->_createContainer(NULL, NULL, '/');
+ [$basedir, $c] = $this->_createContainer(NULL, NULL, '/');
try {
$c->getPath('un.kno.wn');
}
}
public function testGetResUrl() {
- list($basedir, $c) = $this->_createContainer();
+ [$basedir, $c] = $this->_createContainer();
try {
$c->getResUrl('un.kno.wn');
}
}
public function testGetResUrl_extraSlashFromConfig() {
- list($basedir, $c) = $this->_createContainer(NULL, NULL, '/');
+ [$basedir, $c] = $this->_createContainer(NULL, NULL, '/');
try {
$c->getResUrl('un.kno.wn');
}
public function testCaching() {
$cache = new CRM_Utils_Cache_Arraycache([]);
$this->assertTrue(!is_array($cache->get('basic-scan')));
- list($basedir, $c) = $this->_createContainer($cache, 'basic-scan');
+ [$basedir, $c] = $this->_createContainer($cache, 'basic-scan');
$this->assertEquals('http://example/basedir/foo', $c->getResUrl('test.foo'));
$this->assertTrue(is_array($cache->get('basic-scan')));
$this->assertTrue($message->body instanceof ezcMailMultipartAlternative);
- list($textPart, $htmlPart) = $message->body->getParts();
+ [$textPart, $htmlPart] = $message->body->getParts();
$this->assertEquals('html', $htmlPart->subType);
$this->assertRegExp(
$this->assertTrue($message->body instanceof ezcMailMultipartAlternative);
- list($textPart, $htmlPart) = $message->body->getParts();
+ [$textPart, $htmlPart] = $message->body->getParts();
$this->assertEquals('html', $htmlPart->subType);
$this->assertRegExp(
$this->assertTrue($message->body instanceof ezcMailMultipartAlternative);
- list($textPart, $htmlPart) = $message->body->getParts();
+ [$textPart, $htmlPart] = $message->body->getParts();
if ($htmlUrlRegex) {
$caseName = print_r(['inputHtml' => $inputHtml, 'params' => $params, 'htmlUrlRegex' => $htmlUrlRegex, 'htmlPart' => $htmlPart->text], 1);
}
public function testGetHttp() {
- list($status, $data) = $this->client->get(self::VALID_HTTP_URL);
+ [$status, $data] = $this->client->get(self::VALID_HTTP_URL);
$this->assertEquals(CRM_Utils_HttpClient::STATUS_OK, $status);
$this->assertRegExp(self::VALID_HTTP_REGEX, $data);
}
public function testGetHttps_valid() {
- list($status, $data) = $this->client->get(self::VALID_HTTPS_URL);
+ [$status, $data] = $this->client->get(self::VALID_HTTPS_URL);
$this->assertEquals(CRM_Utils_HttpClient::STATUS_OK, $status);
$this->assertRegExp(self::VALID_HTTPS_REGEX, $data);
}
public function testGetHttps_invalid_verify() {
- list($status, $data) = $this->client->get(self::SELF_SIGNED_HTTPS_URL);
+ [$status, $data] = $this->client->get(self::SELF_SIGNED_HTTPS_URL);
$this->assertEquals(CRM_Utils_HttpClient::STATUS_DL_ERROR, $status);
$this->assertEquals('', $data);
}
]);
$this->assertAPISuccess($result);
- list($status, $data) = $this->client->get(self::SELF_SIGNED_HTTPS_URL);
+ [$status, $data] = $this->client->get(self::SELF_SIGNED_HTTPS_URL);
$this->assertEquals(CRM_Utils_HttpClient::STATUS_OK, $status);
$this->assertRegExp(self::SELF_SIGNED_HTTPS_REGEX, $data);
}
* @dataProvider getTwoGenerators
*/
public function testDiff_clearA($cacheA, $cacheB) {
- list($a, $b) = $this->createTwoCaches($cacheA, $cacheB);
+ [$a, $b] = $this->createTwoCaches($cacheA, $cacheB);
$a->set('foo', 1234);
$b->set('foo', 5678);
$this->assertEquals(1234, $a->get('foo'), 'Check value A after initial setup');
* @dataProvider getTwoGenerators
*/
public function testDiff_clearB($cacheA, $cacheB) {
- list($a, $b) = $this->createTwoCaches($cacheA, $cacheB);
+ [$a, $b] = $this->createTwoCaches($cacheA, $cacheB);
$a->set('foo', 1234);
$b->set('foo', 5678);
$this->assertEquals(1234, $a->get('foo'), 'Check value A after initial setup');
* @dataProvider getTwoGenerators
*/
public function testDiff_reload($cacheA, $cacheB) {
- list($a, $b) = $this->createTwoCaches($cacheA, $cacheB);
+ [$a, $b] = $this->createTwoCaches($cacheA, $cacheB);
$a->set('foo', 1234);
$b->set('foo', 5678);
$this->assertEquals(1234, $a->get('foo'), 'Check value A after initial setup');
$this->assertEquals(5678, $b->get('foo'), 'Check value B after initial setup');
- list($a, $b) = $this->createTwoCaches($cacheA, $cacheB);
+ [$a, $b] = $this->createTwoCaches($cacheA, $cacheB);
$this->assertEquals(1234, $a->get('foo'), 'Check value A after initial setup');
$this->assertEquals(5678, $b->get('foo'), 'Check value B after initial setup');
}