Author: weaverryan
Date: 2010-02-06 22:59:06 +0100 (Sat, 06 Feb 2010)
New Revision: 27623

Modified:
   plugins/sfSympalPlugin/trunk/test/unit/ConfigurationTest.php
Log:
[1.4][sfSympalPlugin][1.0] Adding comments to this test and sorting a few 
arrays that were coming back with an incorrect order (different filesystems 
sorting differently?)


Modified: plugins/sfSympalPlugin/trunk/test/unit/ConfigurationTest.php
===================================================================
--- plugins/sfSympalPlugin/trunk/test/unit/ConfigurationTest.php        
2010-02-06 21:01:07 UTC (rev 27622)
+++ plugins/sfSympalPlugin/trunk/test/unit/ConfigurationTest.php        
2010-02-06 21:59:06 UTC (rev 27623)
@@ -1,9 +1,19 @@
 <?php
 
+/**
+ * Unit test for the sfSympalConfiguration class
+ * 
+ * @package     
+ * @subpackage  
+ * @author      Ryan Weaver <[email protected]>
+ * @since       2010-02-06
+ * @version     svn:$Id$ $Author$
+ */
+
 $app = 'sympal';
 require_once(dirname(__FILE__).'/../bootstrap/unit.php');
 
-$t = new lime_test(11, new lime_output_color());
+$t = new lime_test(9, new lime_output_color());
 
 $sympalPluginConfiguration = 
sfContext::getInstance()->getConfiguration()->getPluginConfiguration('sfSympalPlugin');
 $sympalConfiguration = $sympalPluginConfiguration->getSympalConfiguration();
@@ -33,7 +43,7 @@
   'sfSympalContentSyntaxPlugin',
 );
 
-$t->is($sympalConfiguration->getRequiredPlugins(), $requiredPlugins);
+$t->is($sympalConfiguration->getRequiredPlugins(), $requiredPlugins, 
'->getRequiredPlugins() returns the correct array');
 
 $corePlugins = array(
   'sfDoctrineGuardPlugin',
@@ -59,43 +69,34 @@
   'sfSympalContentSyntaxPlugin',
 );
 
-$t->is($sympalConfiguration->getCorePlugins(), $corePlugins);
+$t->is($sympalConfiguration->getCorePlugins(), $corePlugins, 
'->getCorePlugins() returns the correct array');
 
-$t->is(array_values($sympalConfiguration->getInstalledPlugins()), array(
+$installedPlugins = array_values($sympalConfiguration->getInstalledPlugins());
+sort($installedPlugins); // sort the plugins - don't depend on file system to 
return with consistent order
+$t->is($installedPlugins, array(
   'sfSympalBlogPlugin',
   'sfSympalCommentsPlugin',
   'sfSympalThemeTestPlugin'
-));
+), '->getInstalledPlugins() returns the correct array of installed, non-core 
plugins');
 
 $addonPlugins = $sympalConfiguration->getAddonPlugins();
-$t->is(in_array('sfSympalBlogPlugin', $addonPlugins), true);
-$t->is(in_array('sfSympalJwageThemePlugin', $addonPlugins), true);
+$t->is(in_array('sfSympalBlogPlugin', $addonPlugins), true, 
'->getAddonPlugins() returns an array which includes sfSympalBlogPlugin');
+$t->is(in_array('sfSympalJwageThemePlugin', $addonPlugins), true, 
'->getAddonPlugins() returns an array which includes sfSympalJwageThemePlugin');
 
-$t->is(array_values($sympalConfiguration->getOtherPlugins()), array(
+$otherPlugins = array_values($sympalConfiguration->getOtherPlugins());
+sort($otherPlugins); // sort the plugins - don't depend on file system to 
return with consistent order
+$t->is($otherPlugins, array(
   'sfSympalBlogPlugin',
   'sfSympalCommentsPlugin',
   'sfSympalThemeTestPlugin'
-));
+), '->getOtherPlugins() returns the correct array of installed, non-core 
plugins (equivalent to getInstalledPlugins())');
 
-$all = array(
-  'sfSympalBlogPlugin',
-  'sfSympalCommentsPlugin',
-  'sfSympalDoctrineThemePlugin',
-  'sfSympalJwageThemePlugin',
-  'sfSympalOpenAuthPlugin',
-  'sfSympalSlideshowPlugin',
-  'sfSympalSocialFollowPlugin',
-  'sfSympalTagsPlugin',
-);
 
-$t->is(in_array('sfSympalBlogPlugin', $all), true);
-$t->is(in_array('sfSympalJwageThemePlugin', $all), true);
-
 $pluginPaths = $sympalConfiguration->getPluginPaths();
-$t->is($pluginPaths['sfSympalPlugin'], 
$sympalPluginConfiguration->getRootDir());
+$t->is($pluginPaths['sfSympalPlugin'], 
$sympalPluginConfiguration->getRootDir(), '->getRootDir() returns the root path 
to sfSympalPlugin');
 
 $modules = $sympalConfiguration->getModules();
-$t->is(in_array('sympal_content_renderer', $modules), true);
+$t->is(in_array('sympal_content_renderer', $modules), true, '->getModules() 
returns an array with sympal_content_renderer as an entry');
 
 $layouts = $sympalConfiguration->getLayouts();
-$t->is(in_array('sympal', $layouts), true);
\ No newline at end of file
+$t->is(in_array('sympal', $layouts), true, '->getLayouts() returns an array 
with "sympal" as one of its entries');
\ No newline at end of file

-- 
You received this message because you are subscribed to the Google Groups 
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/symfony-svn?hl=en.

Reply via email to