]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #4134 improved plugin manifest tests by using assertIdentical more
authorcash <cash.costello@gmail.com>
Sat, 19 Nov 2011 02:31:21 +0000 (21:31 -0500)
committercash <cash.costello@gmail.com>
Tue, 29 Nov 2011 02:44:00 +0000 (21:44 -0500)
engine/tests/api/plugins.php
engine/tests/test_files/plugin_18/manifest.xml

index ac38f34eadf78ea4e7d137a68c0782bc128b64d7..8ecb0a46c2dfde44a3aab74ffe88d5b6eb2d8824 100644 (file)
@@ -93,23 +93,23 @@ class ElggCorePluginsAPITest extends ElggCoreUnitTest {
                        ),
 
                        'conflicts' => array(
-                               array('type' => 'plugin', 'name' => 'profile_api', 'version' => 1.0)
+                               array('type' => 'plugin', 'name' => 'profile_api', 'version' => '1.0')
                        ),
 
                        'provides' => array(
-                               array('type' => 'plugin', 'name' => 'profile_api', 'version' => 1.3),
-                               array('type' => 'php_extension', 'name' => 'big_math', 'version' => 1.0)
+                               array('type' => 'plugin', 'name' => 'profile_api', 'version' => '1.3'),
+                               array('type' => 'php_extension', 'name' => 'big_math', 'version' => '1.0')
                        ),
 
                        'suggests' => array(
-                               array('type' => 'plugin', 'name' => 'facebook_connect', 'version' => 1.0),
+                               array('type' => 'plugin', 'name' => 'facebook_connect', 'version' => '1.0'),
                        ),
 
                        // string because we are reading from a file
                        'activate_on_install' => 'true',
                );
 
-               $this->assertEqual($this->manifest18->getManifest(), $manifest_array);
+               $this->assertIdentical($this->manifest18->getManifest(), $manifest_array);
        }
 
        public function testElggPluginManifest17() {
@@ -124,7 +124,7 @@ class ElggCorePluginsAPITest extends ElggCoreUnitTest {
                        'name' => 'Plugin Test 17',
                );
 
-               $this->assertEqual($this->manifest17->getManifest(), $manifest_array);
+               $this->assertIdentical($this->manifest17->getManifest(), $manifest_array);
        }
 
 
@@ -181,7 +181,7 @@ class ElggCorePluginsAPITest extends ElggCoreUnitTest {
                        array('type' => 'elgg_version', 'version' => '3009030802', 'comparison' => 'lt'),
                        array('type' => 'elgg_release', 'version' => '1.8-svn', 'comparison' => 'ge'),
                        array('type' => 'php_extension', 'name' => 'gd', 'version' => '', 'comparison' => '='),
-                       array('type' => 'php_ini', 'name' => 'short_open_tag', 'value' => 'off', 'comparison' => '='),
+                       array('type' => 'php_ini', 'name' => 'short_open_tag', 'value' => 0, 'comparison' => '='),
                        array('type' => 'php_extension', 'name' => 'made_up', 'version' => '1.0', 'comparison' => '='),
                        array('type' => 'plugin', 'name' => 'fake_plugin', 'version' => '1.0', 'comparison' => 'ge'),
                        array('type' => 'plugin', 'name' => 'profile', 'version' => '1.0', 'comparison' => 'ge'),
@@ -189,13 +189,13 @@ class ElggCorePluginsAPITest extends ElggCoreUnitTest {
                        array('type' => 'priority', 'priority' => 'after', 'plugin' => 'profile'),
                );
 
-               $this->assertEqual($this->package18->getManifest()->getRequires(), $requires);
+               $this->assertIdentical($this->package18->getManifest()->getRequires(), $requires);
 
                $requires = array(
                        array('type' => 'elgg_version', 'version' => '2009030702', 'comparison' => 'ge')
                );
 
-               $this->assertEqual($this->package17->getManifest()->getRequires(), $requires);
+               $this->assertIdentical($this->package17->getManifest()->getRequires(), $requires);
        }
 
        public function testElggPluginManifestGetSuggests() {
@@ -203,11 +203,11 @@ class ElggCorePluginsAPITest extends ElggCoreUnitTest {
                        array('type' => 'plugin', 'name' => 'facebook_connect', 'version' => '1.0', 'comparison' => 'ge'),
                );
 
-               $this->assertEqual($this->package18->getManifest()->getSuggests(), $suggests);
+               $this->assertIdentical($this->package18->getManifest()->getSuggests(), $suggests);
 
                $suggests = array();
 
-               $this->assertEqual($this->package17->getManifest()->getSuggests(), $suggests);
+               $this->assertIdentical($this->package17->getManifest()->getSuggests(), $suggests);
        }
 
        public function testElggPluginManifestGetDescription() {
@@ -220,8 +220,8 @@ class ElggCorePluginsAPITest extends ElggCoreUnitTest {
                        'Admin', 'ServiceAPI'
                );
 
-               $this->assertEqual($this->package18->getManifest()->getCategories(), $categories);
-               $this->assertEqual($this->package17->getManifest()->getCategories(), array());
+               $this->assertIdentical($this->package18->getManifest()->getCategories(), $categories);
+               $this->assertIdentical($this->package17->getManifest()->getCategories(), array());
        }
 
        public function testElggPluginManifestGetScreenshots() {
@@ -230,25 +230,25 @@ class ElggCorePluginsAPITest extends ElggCoreUnitTest {
                        array('description' => 'Fun things to do 2', 'path' => 'graphics/plugin_ss2.png'),
                );
 
-               $this->assertEqual($this->package18->getManifest()->getScreenshots(), $screenshots);
-               $this->assertEqual($this->package17->getManifest()->getScreenshots(), array());
+               $this->assertIdentical($this->package18->getManifest()->getScreenshots(), $screenshots);
+               $this->assertIdentical($this->package17->getManifest()->getScreenshots(), array());
        }
 
        public function testElggPluginManifestGetProvides() {
                $provides = array(
-                       array('type' => 'plugin', 'name' => 'profile_api', 'version' => 1.3),
-                       array('type' => 'php_extension', 'name' => 'big_math', 'version' => 1.0),
-                       array('type' => 'plugin', 'name' => 'plugin_18', 'version' => 1.0)
+                       array('type' => 'plugin', 'name' => 'profile_api', 'version' => '1.3'),
+                       array('type' => 'php_extension', 'name' => 'big_math', 'version' => '1.0'),
+                       array('type' => 'plugin', 'name' => 'plugin_18', 'version' => '1.0')
                );
 
-               $this->assertEqual($this->package18->getManifest()->getProvides(), $provides);
+               $this->assertIdentical($this->package18->getManifest()->getProvides(), $provides);
 
 
                $provides = array(
                        array('type' => 'plugin', 'name' => 'plugin_17', 'version' => '1.0')
                );
 
-               $this->assertEqual($this->package17->getManifest()->getProvides(), $provides);
+               $this->assertIdentical($this->package17->getManifest()->getProvides(), $provides);
        }
 
        public function testElggPluginManifestGetConflicts() {
@@ -261,12 +261,12 @@ class ElggCorePluginsAPITest extends ElggCoreUnitTest {
                        )
                );
 
-               $this->assertEqual($this->manifest18->getConflicts(), $conflicts);
-               $this->assertEqual($this->manifest17->getConflicts(), array());
+               $this->assertIdentical($this->manifest18->getConflicts(), $conflicts);
+               $this->assertIdentical($this->manifest17->getConflicts(), array());
        }
 
        public function testElggPluginManifestGetActivateOnInstall() {
-               $this->assertEqual($this->manifest18->getActivateOnInstall(), true);
+               $this->assertIdentical($this->manifest18->getActivateOnInstall(), true);
        }
 
        // ElggPluginPackage
index e0776ffc12fe3f3a8875f364bc0cca81905e63e8..9654b6422c65d794c92466d09be3cbe5844b70b8 100644 (file)
@@ -34,8 +34,6 @@
 
        <category>ServiceAPI</category>
 
-       <activate_on_install>true</activate_on_install>
-
        <requires>
                <type>php_extension</type>
                <name>gd</name>
                <version>1.0</version>
        </suggests>
 
+       <activate_on_install>true</activate_on_install>
+
 </plugin_manifest>