Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Add tests for email address passed to create wall

  • Loading branch information...
commit b201c465c6b2b9034c227e21fe46a6dbe01328fd 1 parent 226a2de
Brian Birtles authored March 19, 2013
5  wall/lib/walls.inc
@@ -583,7 +583,8 @@ class Wall {
583 583
                   'wallUrl', 'wallShortUrl',
584 584
                   'editorUrl', 'editorShortUrl',
585 585
                   'duration', 'defaultDuration',
586  
-                  'passcodeLen', 'latestSession');
  586
+                  'ownerEmail', 'passcodeLen',
  587
+                  'latestSession');
587 588
 
588 589
     $result = array();
589 590
     foreach ($keys as $localKey => $keyToExport) {
@@ -809,7 +810,7 @@ class Walls {
809 810
       . ' ,eventName, eventDescr, eventLocation, eventType, eventFinish'
810 811
       . ' ,urlPath, shortUrl, editorShortUrl'
811 812
       . ' ,walls.duration, galleryDisplay, passcode'
812  
-      . ' ,designs.duration AS defaultduration'
  813
+      . ' ,designs.duration AS defaultDuration'
813 814
       . ' ,users.email AS ownerEmail'
814 815
       . ' ,sessionId, beginDate as sessionStart, endDate as sessionEnd'
815 816
       . ' FROM walls'
16  wall/tests/api/TestCreateWall.php
@@ -118,9 +118,19 @@ function testUrl() {
118 118
   }
119 119
 
120 120
   function testEmail() {
121  
-    // Test a bad email is rejected
122  
-    // Test the ownerEmail returned is set to the email we passed in (after 
123  
-    // trimming)
  121
+    $this->login();
  122
+
  123
+    // Test the ownerEmail returned is set to the email we passed in
  124
+    $wall = $this->_createWall('Test wall', $this->testDesignId);
  125
+    $this->assertEqual(@$wall['ownerEmail'], $this->userEmail);
  126
+    $this->removeWall($wall['wallId']);
  127
+
  128
+    // Try a bad email
  129
+    $this->logout();
  130
+    $this->userEmail = 'abc';
  131
+    $this->login();
  132
+    $wall = $this->_createWall('Test wall', $this->testDesignId);
  133
+    $this->assertEqual(@$wall['error_key'], 'bad-email');
124 134
   }
125 135
 
126 136
   function testDesignId() {
2  wall/tests/api/WallMakerTestCase.php
@@ -61,7 +61,7 @@ function login() {
61 61
                                // cache limiting headers
62 62
     session_start();
63 63
 
64  
-    $_SESSION['email'] = 'test@test.org';
  64
+    $_SESSION['email'] = $this->userEmail;
65 65
 
66 66
     // We're about to call into the wall server which will want to access the 
67 67
     // same session but session files are opened exclusively so we store the 

0 notes on commit b201c46

Please sign in to comment.
Something went wrong with that request. Please try again.