aboutsummaryrefslogtreecommitdiff
path: root/engine/tests
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-01-02 23:00:23 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-01-02 23:00:23 +0000
commitfc21edb0785f2cac11dc592278fad97fffeeb082 (patch)
tree24047873840c5931766abaa5b15a73c0692e7565 /engine/tests
parenta826bea54e8934c19b2ada619d966cc7d9628b42 (diff)
downloadelgg-fc21edb0785f2cac11dc592278fad97fffeeb082.tar.gz
elgg-fc21edb0785f2cac11dc592278fad97fffeeb082.tar.bz2
Fixes #1986, #2170, #2225, #2759. Integrated ElggPluginPackage and ElggPluginManifest with ElggPlugin. System now uses ElggPlugin objects to determin plugins. Order is stored in private settings. This absolutely requires running upgrade.php.
git-svn-id: http://code.elgg.org/elgg/trunk@7817 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/tests')
-rw-r--r--engine/tests/api/plugins.php28
-rw-r--r--engine/tests/test_files/plugin_18/manifest.xml11
2 files changed, 27 insertions, 12 deletions
diff --git a/engine/tests/api/plugins.php b/engine/tests/api/plugins.php
index c99609559..997d69fb7 100644
--- a/engine/tests/api/plugins.php
+++ b/engine/tests/api/plugins.php
@@ -100,11 +100,10 @@ class ElggCorePluginsAPITest extends ElggCoreUnitTest {
array('type' => 'php_extension', 'name' => 'big_math', 'version' => 1.0)
),
- 'admin' => array(
- 'on_enable' => 'setup_function',
- 'on_disable' => 'teardown_function',
- 'interface_type' => 'simple'
- )
+ 'on_activate' => array('setup_function'),
+ 'on_deactivate' => array('teardown_function'),
+ 'admin_interface' => 'simple',
+ 'activate_on_install' => true
);
$this->assertEqual($this->manifest18->getManifest(), $manifest_array);
@@ -118,7 +117,8 @@ class ElggCorePluginsAPITest extends ElggCoreUnitTest {
'website' => 'http://www.elgg.org/',
'copyright' => '(C) Elgg 2010',
'license' => 'GNU Public License version 2',
- 'elgg_version' => '2009030702'
+ 'elgg_version' => '2009030702',
+ 'name' => 'Plugin Test 17',
);
$this->assertEqual($this->manifest17->getManifest(), $manifest_array);
@@ -261,6 +261,22 @@ class ElggCorePluginsAPITest extends ElggCoreUnitTest {
$this->assertEqual($this->manifest17->getConflicts(), array());
}
+ public function testElggPluginManifestGetOnActivate() {
+ $this->assertEqual($this->manifest18->getOnActivate(), array('setup_function'));
+ }
+
+ public function testElggPluginManifestGetOnDeactivate() {
+ $this->assertEqual($this->manifest18->getOnDeactivate(), array('teardown_function'));
+ }
+
+ public function testElggPluginManifestGetAdminInterface() {
+ $this->assertEqual($this->manifest18->getAdminInterface(), 'simple');
+ }
+
+ public function testElggPluginManifestGetActivateOnInstall() {
+ $this->assertEqual($this->manifest18->getActivateOnInstall(), true);
+ }
+
// ElggPluginPackage
public function testElggPluginPackageDetectIDFromPath() {
$this->assertEqual($this->package18->getID(), 'plugin_18');
diff --git a/engine/tests/test_files/plugin_18/manifest.xml b/engine/tests/test_files/plugin_18/manifest.xml
index 454a418f6..69166c89c 100644
--- a/engine/tests/test_files/plugin_18/manifest.xml
+++ b/engine/tests/test_files/plugin_18/manifest.xml
@@ -34,11 +34,10 @@
<category>ServiceAPI</category>
- <admin>
- <on_enable>setup_function</on_enable>
- <on_disable>teardown_function</on_disable>
- <interface_type>simple</interface_type>
- </admin>
+ <on_activate>setup_function</on_activate>
+ <on_deactivate>teardown_function</on_deactivate>
+ <admin_interface>simple</admin_interface>
+ <activate_on_install>true</activate_on_install>
<requires>
<type>php_extension</type>
@@ -94,4 +93,4 @@
<version>1.0</version>
</provides>
-</plugin_manifest> \ No newline at end of file
+</plugin_manifest>