aboutsummaryrefslogtreecommitdiffstats
path: root/tests/functional
diff options
context:
space:
mode:
Diffstat (limited to 'tests/functional')
-rw-r--r--tests/functional/extension_acp_test.php21
-rw-r--r--tests/functional/extension_controller_test.php2
-rw-r--r--tests/functional/extension_global_lang_test.php3
-rw-r--r--tests/functional/extension_permission_lang_test.php3
-rw-r--r--tests/functional/fixtures/ext/foo/bar/composer.json2
-rw-r--r--tests/functional/fixtures/ext/foo/bar/config/services.yml9
-rw-r--r--tests/functional/fixtures/ext/foo/bar/event/permission.php9
-rw-r--r--tests/functional/fixtures/ext/foo/bar/event/user_setup.php9
8 files changed, 37 insertions, 21 deletions
diff --git a/tests/functional/extension_acp_test.php b/tests/functional/extension_acp_test.php
index 44bb895f67..5d391e42f7 100644
--- a/tests/functional/extension_acp_test.php
+++ b/tests/functional/extension_acp_test.php
@@ -182,13 +182,34 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case
public function test_actions()
{
+ // Access enable page without hash
$crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=enable&ext_name=vendor%2Fmoo&sid=' . $this->sid);
+ $this->assertContainsLang('FORM_INVALID', $crawler->filter('.errorbox')->text());
+
+ // Correctly submit the enable form
+ $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=enable_pre&ext_name=vendor%2Fmoo&sid=' . $this->sid);
+ $form = $crawler->selectButton('enable')->form();
+ $crawler = self::submit($form);
$this->assertContainsLang('EXTENSION_ENABLE_SUCCESS', $crawler->filter('.successbox')->text());
+ // Access disable page without hash
$crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=disable&ext_name=vendor%2Fmoo&sid=' . $this->sid);
+ $this->assertContainsLang('FORM_INVALID', $crawler->filter('.errorbox')->text());
+
+ // Correctly submit the disable form
+ $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=disable_pre&ext_name=vendor%2Fmoo&sid=' . $this->sid);
+ $form = $crawler->selectButton('disable')->form();
+ $crawler = self::submit($form);
$this->assertContainsLang('EXTENSION_DISABLE_SUCCESS', $crawler->filter('.successbox')->text());
+ // Access delete_data page without hash
$crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=delete_data&ext_name=vendor%2Fmoo&sid=' . $this->sid);
+ $this->assertContainsLang('FORM_INVALID', $crawler->filter('.errorbox')->text());
+
+ // Correctly submit the delete data form
+ $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=delete_data_pre&ext_name=vendor%2Fmoo&sid=' . $this->sid);
+ $form = $crawler->selectButton('delete_data')->form();
+ $crawler = self::submit($form);
$this->assertContainsLang('EXTENSION_DELETE_DATA_SUCCESS', $crawler->filter('.successbox')->text());
}
}
diff --git a/tests/functional/extension_controller_test.php b/tests/functional/extension_controller_test.php
index 41bd48c204..37752b8fbb 100644
--- a/tests/functional/extension_controller_test.php
+++ b/tests/functional/extension_controller_test.php
@@ -19,6 +19,8 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c
static protected $fixtures = array(
'foo/bar/config/',
'foo/bar/controller/',
+ 'foo/bar/event/',
+ 'foo/bar/language/en/',
'foo/bar/styles/prosilver/template/',
);
diff --git a/tests/functional/extension_global_lang_test.php b/tests/functional/extension_global_lang_test.php
index fb8f87e6de..094eda8257 100644
--- a/tests/functional/extension_global_lang_test.php
+++ b/tests/functional/extension_global_lang_test.php
@@ -17,8 +17,9 @@ class phpbb_functional_extension_global_lang_test extends phpbb_functional_test_
static private $helper;
static protected $fixtures = array(
- 'foo/bar/language/en/',
+ 'foo/bar/config/',
'foo/bar/event/',
+ 'foo/bar/language/en/',
);
static public function setUpBeforeClass()
diff --git a/tests/functional/extension_permission_lang_test.php b/tests/functional/extension_permission_lang_test.php
index 19adb89819..e922abdaf1 100644
--- a/tests/functional/extension_permission_lang_test.php
+++ b/tests/functional/extension_permission_lang_test.php
@@ -17,8 +17,9 @@ class phpbb_functional_extension_permission_lang_test extends phpbb_functional_t
static private $helper;
static protected $fixtures = array(
- 'foo/bar/language/en/',
+ 'foo/bar/config/',
'foo/bar/event/',
+ 'foo/bar/language/en/',
);
static public function setUpBeforeClass()
diff --git a/tests/functional/fixtures/ext/foo/bar/composer.json b/tests/functional/fixtures/ext/foo/bar/composer.json
index cb9dbc9514..e3e5fc21cd 100644
--- a/tests/functional/fixtures/ext/foo/bar/composer.json
+++ b/tests/functional/fixtures/ext/foo/bar/composer.json
@@ -14,7 +14,7 @@
}],
"require": {
"php": ">=5.3",
- "phpbb": "3.1.*@dev"
+ "phpbb/phpbb": "3.1.*@dev"
},
"extra": {
"display-name": "phpBB 3.1 Extension Testing"
diff --git a/tests/functional/fixtures/ext/foo/bar/config/services.yml b/tests/functional/fixtures/ext/foo/bar/config/services.yml
index 3bca4c6567..64e1163408 100644
--- a/tests/functional/fixtures/ext/foo/bar/config/services.yml
+++ b/tests/functional/fixtures/ext/foo/bar/config/services.yml
@@ -4,3 +4,12 @@ services:
arguments:
- @controller.helper
- @template
+ foo_bar.listener.permission:
+ class: foo\bar\event\permission
+ tags:
+ - { name: event.listener }
+ foo_bar.listener.user_setup:
+ class: foo\bar\event\user_setup
+ tags:
+ - { name: event.listener }
+
diff --git a/tests/functional/fixtures/ext/foo/bar/event/permission.php b/tests/functional/fixtures/ext/foo/bar/event/permission.php
index 92e24074ad..9b319dd35f 100644
--- a/tests/functional/fixtures/ext/foo/bar/event/permission.php
+++ b/tests/functional/fixtures/ext/foo/bar/event/permission.php
@@ -11,15 +11,6 @@
namespace foo\bar\event;
/**
-* @ignore
-*/
-
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-/**
* Event listener
*/
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
diff --git a/tests/functional/fixtures/ext/foo/bar/event/user_setup.php b/tests/functional/fixtures/ext/foo/bar/event/user_setup.php
index 1409f97470..8fa7ac97da 100644
--- a/tests/functional/fixtures/ext/foo/bar/event/user_setup.php
+++ b/tests/functional/fixtures/ext/foo/bar/event/user_setup.php
@@ -11,15 +11,6 @@
namespace foo\bar\event;
/**
-* @ignore
-*/
-
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-/**
* Event listener
*/
use Symfony\Component\EventDispatcher\EventSubscriberInterface;