You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@shindig.apache.org by li...@apache.org on 2011/11/22 22:05:51 UTC

svn commit: r1205169 - in /shindig/trunk/php: src/common/sample/BasicSecurityToken.php src/gadgets/MakeRequest.php test/common/BasicSecurityTokenTest.php test/social/InputPeopleConverterTest.php

Author: lindner
Date: Tue Nov 22 21:05:50 2011
New Revision: 1205169

URL: http://svn.apache.org/viewvc?rev=1205169&view=rev
Log:
Fix tests for phpunit 3.6

Modified:
    shindig/trunk/php/src/common/sample/BasicSecurityToken.php
    shindig/trunk/php/src/gadgets/MakeRequest.php
    shindig/trunk/php/test/common/BasicSecurityTokenTest.php
    shindig/trunk/php/test/social/InputPeopleConverterTest.php

Modified: shindig/trunk/php/src/common/sample/BasicSecurityToken.php
URL: http://svn.apache.org/viewvc/shindig/trunk/php/src/common/sample/BasicSecurityToken.php?rev=1205169&r1=1205168&r2=1205169&view=diff
==============================================================================
--- shindig/trunk/php/src/common/sample/BasicSecurityToken.php (original)
+++ shindig/trunk/php/src/common/sample/BasicSecurityToken.php Tue Nov 22 21:05:50 2011
@@ -20,6 +20,10 @@
 
 require_once 'external/OAuth/OAuth.php';
 
+class BasicSecurityTokenException extends Exception {
+}
+
+
 /**
  * Primitive token implementation that uses stings as tokens.
  */
@@ -142,7 +146,7 @@ class BasicSecurityToken extends Securit
    */
   public function getAppId() {
     if ($this->isAnonymous()) {
-      throw new Exception("Can't get appId from an anonymous token");
+      throw new BasicSecurityTokenException("Can't get appId from an anonymous token");
     }
     return $this->tokenData[$this->APP_KEY];
   }
@@ -152,7 +156,7 @@ class BasicSecurityToken extends Securit
    */
   public function getDomain() {
     if ($this->isAnonymous()) {
-      throw new Exception("Can't get domain from an anonymous token");
+      throw new BasicSecurityTokenException("Can't get domain from an anonymous token");
     }
     return $this->tokenData[$this->DOMAIN_KEY];
   }
@@ -162,7 +166,7 @@ class BasicSecurityToken extends Securit
    */
   public function getOwnerId() {
     if ($this->isAnonymous()) {
-      throw new Exception("Can't get ownerId from an anonymous token");
+      throw new BasicSecurityTokenException("Can't get ownerId from an anonymous token");
     }
     return $this->tokenData[$this->OWNER_KEY];
   }
@@ -172,7 +176,7 @@ class BasicSecurityToken extends Securit
    */
   public function getViewerId() {
     if ($this->isAnonymous()) {
-      throw new Exception("Can't get viewerId from an anonymous token");
+      throw new BasicSecurityTokenException("Can't get viewerId from an anonymous token");
     }
     return $this->tokenData[$this->VIEWER_KEY];
   }
@@ -182,7 +186,7 @@ class BasicSecurityToken extends Securit
    */
   public function getAppUrl() {
     if ($this->isAnonymous()) {
-      throw new Exception("Can't get appUrl from an anonymous token");
+      throw new BasicSecurityTokenException("Can't get appUrl from an anonymous token");
     }
     return urldecode($this->tokenData[$this->APPURL_KEY]);
   }
@@ -192,10 +196,10 @@ class BasicSecurityToken extends Securit
    */
   public function getModuleId() {
     if ($this->isAnonymous()) {
-      throw new Exception("Can't get moduleId from an anonymous token");
+      throw new BasicSecurityTokenException("Can't get moduleId from an anonymous token");
     }
     if (! is_numeric($this->tokenData[$this->MODULE_KEY])) {
-      throw new Exception("Module ID should be an integer");
+      throw new BasicSecurityTokenException("Module ID should be an integer");
     }
     return $this->tokenData[$this->MODULE_KEY];
   }
@@ -205,7 +209,7 @@ class BasicSecurityToken extends Securit
    */
   public function getContainer() {
     if ($this->isAnonymous()) {
-      throw new Exception("Can't get container from an anonymous token");
+      throw new BasicSecurityTokenException("Can't get container from an anonymous token");
     }
     return $this->tokenData[$this->CONTAINER_KEY];
   }

Modified: shindig/trunk/php/src/gadgets/MakeRequest.php
URL: http://svn.apache.org/viewvc/shindig/trunk/php/src/gadgets/MakeRequest.php?rev=1205169&r1=1205168&r2=1205169&view=diff
==============================================================================
--- shindig/trunk/php/src/gadgets/MakeRequest.php (original)
+++ shindig/trunk/php/src/gadgets/MakeRequest.php Tue Nov 22 21:05:50 2011
@@ -260,7 +260,7 @@ class MakeRequest {
    * @return response string, either a json encoded feed structure or an error message
    */
   private function parseFeed($result, $url, $numEntries = 3, $getSummaries = false) {
-    require 'external/Zend/Feed.php';
+    require_once 'external/Zend/Feed.php';
     $channel = array();
     if ((int)$result->getHttpCode() == 200) {
       $content = $result->getResponseContent();

Modified: shindig/trunk/php/test/common/BasicSecurityTokenTest.php
URL: http://svn.apache.org/viewvc/shindig/trunk/php/test/common/BasicSecurityTokenTest.php?rev=1205169&r1=1205168&r2=1205169&view=diff
==============================================================================
--- shindig/trunk/php/test/common/BasicSecurityTokenTest.php (original)
+++ shindig/trunk/php/test/common/BasicSecurityTokenTest.php Tue Nov 22 21:05:50 2011
@@ -84,7 +84,7 @@ class BasicSecurityTokenTest extends PHP
    */
   public function testGetAppId() {
     $this->assertEquals('app', $this->BasicSecurityToken->getAppId());
-    $this->setExpectedException('Exception');
+    $this->setExpectedException('BasicSecurityTokenException');
     $this->anonymousToken->getAppId();
   }
 
@@ -93,7 +93,7 @@ class BasicSecurityTokenTest extends PHP
    */
   public function testGetAppUrl() {
     $this->assertEquals('appUrl', $this->BasicSecurityToken->getAppUrl());
-    $this->setExpectedException('Exception');
+    $this->setExpectedException('BasicSecurityTokenException');
     $this->anonymousToken->getAppUrl();
   }
 
@@ -102,7 +102,7 @@ class BasicSecurityTokenTest extends PHP
    */
   public function testGetDomain() {
     $this->assertEquals('domain', $this->BasicSecurityToken->getDomain());
-    $this->setExpectedException('Exception');
+    $this->setExpectedException('BasicSecurityTokenException');
     $this->anonymousToken->getDomain();
   }
 
@@ -111,7 +111,7 @@ class BasicSecurityTokenTest extends PHP
    */
   public function testGetModuleId() {
     $this->assertEquals(1, $this->BasicSecurityToken->getModuleId());
-    $this->setExpectedException('Exception');
+    $this->setExpectedException('BasicSecurityTokenException');
     $this->anonymousToken->getModuleId();
   }
 
@@ -120,7 +120,7 @@ class BasicSecurityTokenTest extends PHP
    */
   public function testGetOwnerId() {
     $this->assertEquals('owner', $this->BasicSecurityToken->getOwnerId());
-    $this->setExpectedException('Exception');
+    $this->setExpectedException('BasicSecurityTokenException');
     $this->anonymousToken->getOwnerId();
   }
 
@@ -129,7 +129,7 @@ class BasicSecurityTokenTest extends PHP
    */
   public function testGetViewerId() {
     $this->assertEquals('viewer', $this->BasicSecurityToken->getViewerId());
-    $this->setExpectedException('Exception');
+    $this->setExpectedException('BasicSecurityTokenException');
     $this->anonymousToken->getViewerId();
   }
 

Modified: shindig/trunk/php/test/social/InputPeopleConverterTest.php
URL: http://svn.apache.org/viewvc/shindig/trunk/php/test/social/InputPeopleConverterTest.php?rev=1205169&r1=1205168&r2=1205169&view=diff
==============================================================================
--- shindig/trunk/php/test/social/InputPeopleConverterTest.php (original)
+++ shindig/trunk/php/test/social/InputPeopleConverterTest.php Tue Nov 22 21:05:50 2011
@@ -45,17 +45,17 @@ class InputPeopleConverterTest extends P
   }
 
   public function testConvertAtom() {
-    $this->setExpectedException('Exception');
+    $this->setExpectedException('SocialSpiException');
     $this->inputConverter->convertAtom('');
   }
 
   public function testConvertJson() {
-    $this->setExpectedException('Exception');
-    $this->inputConverter->convertJson();
+    $this->setExpectedException('SocialSpiException');
+    $this->inputConverter->convertJson('');
   }
 
   public function testConvertXml() {
-    $this->setExpectedException('Exception');
+    $this->setExpectedException('SocialSpiException');
     $this->inputConverter->convertXml('');
   }
 }