Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test tweaks that *might* help with intermittant test weirdness #14458

Merged
merged 1 commit into from
Jun 6, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions tests/phpunit/E2E/Core/PrevNextTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ protected function setUp() {
parent::setUp();
$this->prevNext = \Civi::service('prevnext');
$this->cacheKey = 'PrevNextTest_' . \CRM_Utils_String::createRandom(16, \CRM_Utils_String::ALPHANUMERIC);
$this->cacheKeyB = 'PrevNextTest_' . \CRM_Utils_String::createRandom(16, \CRM_Utils_String::ALPHANUMERIC);
$this->cacheKeyB = 'PrevNextTestb_' . \CRM_Utils_String::createRandom(16, \CRM_Utils_String::ALPHANUMERIC);
$this->assertTrue(
\CRM_Core_DAO::singleValueQuery('SELECT count(*) FROM civicrm_contact') > 25,
'The contact table must have at least 25 records.'
Expand All @@ -40,6 +40,7 @@ protected function setUp() {

protected function tearDown() {
\Civi::service('prevnext')->deleteItem(NULL, $this->cacheKey);
\Civi::service('prevnext')->deleteItem(NULL, $this->cacheKeyB);
}

public function testFillSql() {
Expand Down Expand Up @@ -331,7 +332,7 @@ protected function assertSelections($ids, $action = 'get', $cacheKey = NULL) {
$cacheKey = $this->cacheKey;
}
$selected = $this->prevNext->getSelection($cacheKey, $action)[$cacheKey];
$this->assertEquals($ids, array_keys($selected));
$this->assertEquals($ids, array_keys($selected), 'selected cache not correct for ' . $cacheKey . 'defined keys are ' . $this->cacheKey . 'and ' . $this->cacheKeyB);
$this->assertCount(count($ids), $selected);
}

Expand Down