Author: Jonathan.Wage
Date: 2010-01-14 22:25:17 +0100 (Thu, 14 Jan 2010)
New Revision: 26653

Added:
   plugins/sfSympalPlugin/trunk/test/functional/CommentsTest.php
   plugins/sfSympalPlugin/trunk/test/functional/RedirectsTest.php
Modified:
   plugins/sfSympalPlugin/trunk/test/bootstrap/cleanup.php
   plugins/sfSympalPlugin/trunk/test/functional/AdminGenTest.php
Log:
[1.4][sfSympalPlugin][1.0] Fixing issue with tests and adding some additional 
tests for redirects and comments


Modified: plugins/sfSympalPlugin/trunk/test/bootstrap/cleanup.php
===================================================================
--- plugins/sfSympalPlugin/trunk/test/bootstrap/cleanup.php     2010-01-14 
20:20:26 UTC (rev 26652)
+++ plugins/sfSympalPlugin/trunk/test/bootstrap/cleanup.php     2010-01-14 
21:25:17 UTC (rev 26653)
@@ -6,7 +6,6 @@
   sfToolkit::clearDirectory(dirname(__FILE__).'/../fixtures/project/log');
 
   @unlink(dirname(__FILE__) . '/../fixtures/project/data/test.sqlite');
-  @unlink(sfConfig::get('sf_config_dir').'/app.yml');
 }
 
 copy(dirname(__FILE__).'/../fixtures/project/data/fresh_test_db.sqlite', 
dirname(__FILE__).'/../fixtures/project/data/test.sqlite');

Modified: plugins/sfSympalPlugin/trunk/test/functional/AdminGenTest.php
===================================================================
--- plugins/sfSympalPlugin/trunk/test/functional/AdminGenTest.php       
2010-01-14 20:20:26 UTC (rev 26652)
+++ plugins/sfSympalPlugin/trunk/test/functional/AdminGenTest.php       
2010-01-14 21:25:17 UTC (rev 26653)
@@ -10,7 +10,7 @@
   'sympal_users' => '/admin/security/user',
   'sympal_groups' => '/admin/security/group',
   'sympal_permissions' => '/admin/security/permission',
-  //'sympal_content' => '/admin/content',
+  'sympal_content' => '/admin/content',
   'sympal_content_types' => '/admin/content/types',
   'sympal_sites' => '/admin/sites'
 );

Added: plugins/sfSympalPlugin/trunk/test/functional/CommentsTest.php
===================================================================
--- plugins/sfSympalPlugin/trunk/test/functional/CommentsTest.php               
                (rev 0)
+++ plugins/sfSympalPlugin/trunk/test/functional/CommentsTest.php       
2010-01-14 21:25:17 UTC (rev 26653)
@@ -0,0 +1,27 @@
+<?php
+
+require_once(dirname(__FILE__).'/../bootstrap/functional.php');
+
+$browser = new sfSympalTestFunctional(new sfBrowser());
+
+$browser->
+  signInAsAdmin()->
+  get('/blog-post/sample_blogpost')->
+  click('Save', array('sf_sympal_comment' => array(
+    'subject' => 'Test',
+    'body' => 'Test',
+  )), array('_with_csrf' => true))
+;
+
+Doctrine_Core::getTable('sfSympalBlogPost')->getConnection()->clear();
+
+$browser->
+  with('response')->begin()->
+    isRedirected()->
+    followRedirect()->
+  end()->
+  with('response')->begin()->
+    matches('/comment_1/')->
+    matches('/Posted on (.*) by Sympal Admin./')->
+  end()
+;
\ No newline at end of file

Added: plugins/sfSympalPlugin/trunk/test/functional/RedirectsTest.php
===================================================================
--- plugins/sfSympalPlugin/trunk/test/functional/RedirectsTest.php              
                (rev 0)
+++ plugins/sfSympalPlugin/trunk/test/functional/RedirectsTest.php      
2010-01-14 21:25:17 UTC (rev 26653)
@@ -0,0 +1,48 @@
+<?php
+
+$app = 'sympal';
+require_once(dirname(__FILE__).'/../bootstrap/functional.php');
+
+$browser = new sfSympalTestFunctional(new sfBrowser());
+
+$redirect = new sfSympalRedirect();
+$redirect->source = '/test_redirect';
+$redirect->destination = '@homepage';
+$redirect->site_id = sfSympalContext::getInstance()->getSite()->getId();
+$redirect->save();
+
+$browser->
+  get('/test_redirect')->
+  with('response')->begin()->
+    isRedirected()->
+    followRedirect()->
+  end()->
+  with('request')->begin()->
+    isParameter('module', 'sympal_content_renderer')->
+    isParameter('action', 'index')->
+  end()->
+  with('response')->begin()->
+    matches('/Home/')->
+  end()
+;
+
+$redirect = new sfSympalRedirect();
+$redirect->source = '/test_redirect2';
+$redirect->site_id = sfSympalContext::getInstance()->getSite()->getId();
+$redirect->content_id = 1;
+$redirect->save();
+
+$browser->
+  get('/test_redirect2')->
+  with('response')->begin()->
+    isRedirected()->
+    followRedirect()->
+  end()->
+  with('request')->begin()->
+    isParameter('module', 'sympal_content_renderer')->
+    isParameter('action', 'index')->
+  end()->
+  with('response')->begin()->
+    matches('/Sample Content List/')->
+  end()
+;
\ 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