Author: chabotc
Date: Tue Nov 18 22:55:02 2008
New Revision: 718867
URL: http://svn.apache.org/viewvc?rev=718867&view=rev
Log:
SHINDIG-674 unit test case by Pan Jie
Modified:
incubator/shindig/trunk/php/test/common/BasicRemoteContentTest.php
Modified: incubator/shindig/trunk/php/test/common/BasicRemoteContentTest.php
URL:
http://svn.apache.org/viewvc/incubator/shindig/trunk/php/test/common/BasicRemoteContentTest.php?rev=718867&r1=718866&r2=718867&view=diff
==============================================================================
--- incubator/shindig/trunk/php/test/common/BasicRemoteContentTest.php
(original)
+++ incubator/shindig/trunk/php/test/common/BasicRemoteContentTest.php Tue Nov
18 22:55:02 2008
@@ -20,7 +20,7 @@
protected function setUp()
{
parent::setUp();
- $this->BasicRemoteContent = new BasicRemoteContent();
+ $this->BasicRemoteContent = new BasicRemoteContent();
}
/**
@@ -28,7 +28,7 @@
*/
protected function tearDown()
{
- $this->BasicRemoteContent = null;
+ $this->BasicRemoteContent = null;
parent::tearDown();
}
@@ -43,7 +43,7 @@
$content = $ret->getResponseContent();
$this->assertEquals("OK", trim($content));
}
-
+
/**
* Tests BasicRemoteContent->fetch() 404 response
*/
@@ -54,7 +54,7 @@
$ret = $this->BasicRemoteContent->fetch($request, $context);
$this->assertEquals('404', $ret->getHttpCode());
}
-
+
/**
* Tests BasicRemoteContent->fetch() 200, 200 and 200 responses
*/
@@ -80,7 +80,7 @@
$this->assertEquals('200', $rets[1]->getHttpCode());
$this->assertEquals('200', $rets[2]->getHttpCode());
}
-
+
/**
* Tests BasicRemoteContent->Multifetch() 200, 200 and 404 responses
*/
@@ -94,7 +94,7 @@
$contexts[] = new TestContext();
$contexts[] = new TestContext();
$contexts[] = new TestContext();
-
+
$rets = $this->BasicRemoteContent->multiFetch($requests,
$contexts);
$content_0 = $rets[0]->getResponseContent();
$content_1 = $rets[1]->getResponseContent();
@@ -123,4 +123,16 @@
$this->assertEquals('404', $rets[1]->getHttpCode());
$this->assertEquals('404', $rets[2]->getHttpCode());
}
+
+ /*
+ * Tests BasicRemoteContent->fetch. This unit test is for reproduce
SHINDIG-674.
+ */
+ public function testFeedFetch()
+ {
+ $request = new
RemoteContentRequest('http://adwordsapi.blogspot.com/atom.xml');
+ $context = new TestContext();
+ $ret = $this->BasicRemoteContent->fetch($request, $context);
+ $content = $ret->getResponseContent();
+ $this->assertNotEquals(null, $content);
+ }
}