Skip to content

Commit 3cbbae3

Browse files
committed
Extra assertion in case not found where expected
1 parent e5c44fa commit 3cbbae3

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

tests/functional/google_analytics_test.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ public function test_set_acp_settings()
4242
$this->add_lang('acp/board');
4343
$this->add_lang_ext('phpbb/googleanalytics', 'googleanalytics_acp');
4444

45+
$found = false;
46+
4547
// Load ACP board settings page
4648
$crawler = self::request('GET', 'adm/index.php?i=acp_board&mode=settings&sid=' . $this->sid);
4749

@@ -54,9 +56,17 @@ public function test_set_acp_settings()
5456
continue;
5557
}
5658

59+
$found = true;
60+
5761
$this->assertContainsLang('ACP_GOOGLEANALYTICS_ID', $nodes[$key + 1]);
5862
}
5963

64+
// If GA settings not found where expected, test if they exist on page at all
65+
if (!$found)
66+
{
67+
$this->assertContainsLang('ACP_GOOGLEANALYTICS_ID', $crawler->text());
68+
}
69+
6070
// Set GA form values
6171
$form = $crawler->selectButton($this->lang('SUBMIT'))->form();
6272
$values = $form->getValues();

0 commit comments

Comments
 (0)