Author: ornicar2
Date: 2010-02-08 11:07:38 +0100 (Mon, 08 Feb 2010)
New Revision: 27702

Added:
   
plugins/diemPlugin/trunk/dmCorePlugin/test/project/test/unit/dmFrontThemeTest.php
Modified:
   plugins/diemPlugin/trunk/dmCorePlugin/test/project/test/unit/dmModuleTest.php
   
plugins/diemPlugin/trunk/dmCorePlugin/test/project/test/unit/dmProjectLoremizerTest.php
Log:
[Diem]
- added unit tests for theming and updated unit tests for user integration

Added: 
plugins/diemPlugin/trunk/dmCorePlugin/test/project/test/unit/dmFrontThemeTest.php
===================================================================
--- 
plugins/diemPlugin/trunk/dmCorePlugin/test/project/test/unit/dmFrontThemeTest.php
                           (rev 0)
+++ 
plugins/diemPlugin/trunk/dmCorePlugin/test/project/test/unit/dmFrontThemeTest.php
   2010-02-08 10:07:38 UTC (rev 27702)
@@ -0,0 +1,52 @@
+<?php
+
+require_once(realpath(dirname(__FILE__).'/../../..').'/unit/helper/dmModuleUnitTestHelper.php');
+$helper = new dmModuleUnitTestHelper();
+$helper->boot('front');
+
+$t = new lime_test();
+
+$manager = $helper->get('theme_manager');
+
+$default = $manager->getDefaultTheme();
+$t->isa_ok($default, 'dmTheme', 'default theme is a dmTheme');
+$t->is($default->getName(), 'Fancy Theme', 'default theme name is Fancy 
Theme');
+$t->is($default->getPath(), '/fancyTheme/', 'default theme path is 
fancyTheme');
+$t->ok($default->isEnabled(), 'default theme is enabled');
+$t->ok($default->exists(), 'Fancy Theme exists');
+
+$first = $manager->getTheme('First Theme');
+$t->isa_ok($first, 'dmTheme', 'first theme is a dmTheme');
+$t->is($first->getName(), 'First Theme', 'first theme name is First Theme');
+$t->is($first->getPath(), '/theme/', 'first theme path is theme');
+$t->ok(!$first->isEnabled(), 'first theme is not enabled');
+$t->ok(!$first->exists(), 'First Theme does not exist');
+
+$another = $manager->getTheme('Another Theme');
+$t->isa_ok($another, 'dmTheme', 'another theme is a dmTheme');
+$t->is($another->getName(), 'Another Theme', 'another theme name is Fancy 
Theme');
+$t->is($another->getPath(), '/anotherTheme/', 'another theme path is 
fancyTheme');
+$t->ok($another->isEnabled(), 'another theme is enabled');
+$t->ok(!$another->exists(), 'Another Theme does not exist');
+
+$t->is_deeply(
+  $manager->getThemeNames(),
+  $expected = array('First Theme', 'Fancy Theme', 'Another Theme'),
+  'Theme names are '.implode(', ', $expected)
+);
+
+$t->is($manager->getDefaultThemeName(), 'Fancy Theme', 'default theme name is 
Fancy Theme');
+
+$t->is($manager->getDefaultTheme(), $default, 'default theme is Fancy Theme');
+
+$t->ok($manager->themeNameExists('Fancy Theme'), 'Fancy Theme exists');
+$t->ok(!$manager->themeNameExists('Uncool Theme'), 'Uncool Theme does not 
exist');
+
+$t->is_deeply(
+  $manager->getThemesEnabled(),
+  $expected = array(
+    'Fancy Theme' => $default,
+    'Another Theme' => $another
+  ),
+  'themes enabled are '.implode(', ', array_keys($expected))
+);


Property changes on: 
plugins/diemPlugin/trunk/dmCorePlugin/test/project/test/unit/dmFrontThemeTest.php
___________________________________________________________________
Added: svn:executable
   + *

Modified: 
plugins/diemPlugin/trunk/dmCorePlugin/test/project/test/unit/dmModuleTest.php
===================================================================
--- 
plugins/diemPlugin/trunk/dmCorePlugin/test/project/test/unit/dmModuleTest.php   
    2010-02-08 10:06:32 UTC (rev 27701)
+++ 
plugins/diemPlugin/trunk/dmCorePlugin/test/project/test/unit/dmModuleTest.php   
    2010-02-08 10:07:38 UTC (rev 27702)
@@ -6,7 +6,7 @@
 
 $moduleManager = $helper->get('module_manager');
 
-$t = new lime_test(75);
+$t = new lime_test(83);
 
 $t->comment('Is module test');
 
@@ -47,7 +47,8 @@
 $t->comment('Module components tests');
 
 foreach(array(
-  'main' => 'header footer loginForm sitemap',
+  'main' => 'header footer sitemap',
+  'dmUser' => 'signin form list show',
   'dmTestCateg' => 'list listByDomain show',
   'dmTestPost' => 'listByDomain listByCateg listByTag show',
   'dmTestComment' => 'listByDomain listByCateg listByPost form'
@@ -78,7 +79,9 @@
   'dmTestCateg dmTestDomain' => true,
   'dmTestTag dmTestTag' => false,
   'dmTestTag dmTestDomain' => false,
-  'dmTestTag dmTestComment' => false
+  'dmTestTag dmTestComment' => false,
+  'dmTestTag dmUser' => false,
+  'dmUser dmTestTag' => false
 ) as $modules => $hasAncestor)
 {
   $modules = explode(' ', $modules);
@@ -114,6 +117,7 @@
 foreach(array(
   'dmTestFruit' => array(),
   'dmTestTag' => array(),
+  'dmUser' => array(),
   'dmTestDomain' => array(),
   'dmTestCateg' => array('dmTestDomain'),
   'dmTestPost' => array('dmTestDomain', 'dmTestCateg'),
@@ -128,6 +132,7 @@
 foreach(array(
   'dmTestFruit' => array('dmTestFruit'),
   'dmTestTag' => array('dmTestTag'),
+  'dmUser' => array('dmUser'),
   'dmTestDomain' => array('dmTestDomain'),
   'dmTestCateg' => array('dmTestDomain', 'dmTestCateg'),
   'dmTestPost' => array('dmTestDomain', 'dmTestCateg', 'dmTestPost'),
@@ -143,6 +148,7 @@
   'dmTestFruit' => null,
   'dmTestTag' => null,
   'dmTestDomain' => null,
+  'dmUser' => null,
   'dmTestCateg' => 'dmTestDomain',
   'dmTestPost' => 'dmTestDomain',
   'dmTestComment' => 'dmTestDomain'

Modified: 
plugins/diemPlugin/trunk/dmCorePlugin/test/project/test/unit/dmProjectLoremizerTest.php
===================================================================
--- 
plugins/diemPlugin/trunk/dmCorePlugin/test/project/test/unit/dmProjectLoremizerTest.php
     2010-02-08 10:06:32 UTC (rev 27701)
+++ 
plugins/diemPlugin/trunk/dmCorePlugin/test/project/test/unit/dmProjectLoremizerTest.php
     2010-02-08 10:07:38 UTC (rev 27702)
@@ -4,7 +4,7 @@
 $helper = new dmUnitTestHelper();
 $helper->boot();
 
-$t = new lime_test(66);
+$t = new lime_test(60);
 
 $helper->clearDatabase($t);
 

-- 
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