diff options
| author | Marc Alexander <admin@m-a-styles.de> | 2015-02-14 15:59:29 +0100 | 
|---|---|---|
| committer | Marc Alexander <admin@m-a-styles.de> | 2015-02-14 17:59:59 +0100 | 
| commit | 8314ce6871c3e6f28c5bc374d1b73afc85f58b85 (patch) | |
| tree | adbfa2f5b704d0cd06d096a24295227668c7ad27 | |
| parent | 9e3bc9a3f99d9a29702e4f8e45480ffd7f1c8003 (diff) | |
| download | forums-8314ce6871c3e6f28c5bc374d1b73afc85f58b85.tar forums-8314ce6871c3e6f28c5bc374d1b73afc85f58b85.tar.gz forums-8314ce6871c3e6f28c5bc374d1b73afc85f58b85.tar.bz2 forums-8314ce6871c3e6f28c5bc374d1b73afc85f58b85.tar.xz forums-8314ce6871c3e6f28c5bc374d1b73afc85f58b85.zip  | |
[ticket/13612] Run meta refresh until extension is fully enabled
PHPBB3-13612
| -rw-r--r-- | tests/test_framework/phpbb_functional_test_case.php | 21 | 
1 files changed, 20 insertions, 1 deletions
diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php index b6769f08d0..7479221263 100644 --- a/tests/test_framework/phpbb_functional_test_case.php +++ b/tests/test_framework/phpbb_functional_test_case.php @@ -410,7 +410,26 @@ class phpbb_functional_test_case extends phpbb_test_case  		$form = $crawler->selectButton('Enable')->form();  		$crawler = self::submit($form);  		$this->add_lang('acp/extensions'); -		$this->assertContainsLang('EXTENSION_ENABLE_SUCCESS', $crawler->filter('div.successbox')->text()); + +		$meta_refresh = $crawler->filter('meta[http-equiv="refresh"]'); + +		// Wait for extension to be fully enabled +		while (sizeof($meta_refresh)) +		{ +			preg_match('#url=.+/(adm+.+)#', $meta_refresh->attr('content'), $match); +			$url = $match[1]; +			$crawler = self::request('POST', $url); +			$meta_refresh = $crawler->filter('meta[http-equiv="refresh"]'); +		} + +		if (!empty($meta_refresh)) +		{ +			$this->assertContainsLang('EXTENSIONS_ADMIN', $crawler->filter('.main > h1')->text()); +		} +		else +		{ +			$this->assertContainsLang('EXTENSION_ENABLE_SUCCESS', $crawler->filter('div.successbox')->text()); +		}  		$this->logout();  	}  | 
