forked from rxu/thanks_for_posts
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
102 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?php | ||
/** | ||
* | ||
* Thanks for posts extension. An extension for the phpBB Forum Software package. | ||
* | ||
* @copyright (c) 2018, rxu, www.phpbbguru.net | ||
* @license GNU General Public License, version 2 (GPL-2.0) | ||
* | ||
*/ | ||
|
||
namespace gfksx\thanksforposts\tests\functional; | ||
|
||
/** | ||
* @group functional | ||
*/ | ||
class acp_test extends \phpbb_functional_test_case | ||
{ | ||
static protected function setup_extensions() | ||
{ | ||
return array('gfksx/thanksforposts'); | ||
} | ||
|
||
public function test_update_counters_module() | ||
{ | ||
$this->login(); | ||
$this->admin_login(); | ||
|
||
$this->add_lang_ext('gfksx/thanksforposts', 'info_acp_thanks'); | ||
|
||
$crawler = self::request('GET', "adm/index.php?sid={$this->sid}&i=-gfksx-thanksforposts-acp-acp_thanks_refresh_module&mode=thanks"); | ||
$this->assertContains($this->lang('WARNING'), $crawler->filter('div[class="errorbox"] > h3')->text()); | ||
$this->assertContains($this->lang('THANKS_REFRESH_MSG'), $crawler->filter('div[class="errorbox"] > p')->text()); | ||
|
||
$form = $crawler->selectButton('Refresh')->form(); | ||
$crawler = self::submit($form); | ||
$this->assertContains($this->lang('CONFIRM'), $crawler->filter('fieldset > h1')->text()); | ||
|
||
$form = $crawler->selectButton('Yes')->form(); | ||
$crawler = self::submit($form); | ||
$this->assertContains($this->lang('NOTIFY'), $crawler->filter('div[class="successbox"] > h3')->text()); | ||
$this->assertContains($this->lang('THANKS_REFRESHED_MSG'), $crawler->filter('div[class="successbox"] > p')->text()); | ||
} | ||
|
||
public function test_clear_list_of_thanks_module() | ||
{ | ||
$this->login(); | ||
$this->admin_login(); | ||
|
||
$this->add_lang_ext('gfksx/thanksforposts', 'info_acp_thanks'); | ||
|
||
$crawler = self::request('GET', "adm/index.php?sid={$this->sid}&i=-gfksx-thanksforposts-acp-acp_thanks_truncate_module&mode=thanks"); | ||
$this->assertContains($this->lang('WARNING'), $crawler->filter('div[class="errorbox"] > h3')->text()); | ||
$this->assertContains($this->lang('TRUNCATE_THANKS_EXPLAIN'), $crawler->filter('div[class="errorbox"] > p')->text()); | ||
|
||
$form = $crawler->selectButton('Clear')->form(); | ||
$crawler = self::submit($form); | ||
$this->assertContains($this->lang('ACP_THANKS_TRUNCATE'), $crawler->filter('fieldset > h1')->text()); | ||
|
||
$form = $crawler->selectButton('Yes')->form(); | ||
$crawler = self::submit($form); | ||
$this->assertContains($this->lang('NOTIFY'), $crawler->filter('div[class="successbox"] > h3')->text()); | ||
$this->assertContains($this->lang('TRUNCATE_THANKS_MSG'), $crawler->filter('div[class="successbox"] > p')->text()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.