X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=tests%2F5DemofilesTest.php;h=3cbb5b44439f54804cbef41919a42604a9848a0b;hb=37782a719db2fbe02fe3462edcb06e89f6d58aac;hp=be97eeb12924dd8967a09a9fe3f1f897bafcf91e;hpb=9ffe753899c3103deb271908e0be352e29aa770e;p=plcapi.git
diff --git a/tests/5DemofilesTest.php b/tests/5DemofilesTest.php
index be97eeb..3cbb5b4 100644
--- a/tests/5DemofilesTest.php
+++ b/tests/5DemofilesTest.php
@@ -1,46 +1,12 @@
testId = get_class($this) . '__' . $this->getName();
-
- if ($result === NULL) {
- $result = $this->createResult();
- }
-
- $this->collectCodeCoverageInformation = $result->getCollectCodeCoverageInformation();
-
- parent::run($result);
-
- if ($this->collectCodeCoverageInformation) {
- $coverage = new PHPUnit_Extensions_SeleniumCommon_RemoteCoverage(
- $this->coverageScriptUrl,
- $this->testId
- );
- $result->getCodeCoverage()->append(
- $coverage->get(), $this
- );
- }
-
- // do not call this before to give the time to the Listeners to run
- //$this->getStrategy()->endOfTest($this->session);
-
- return $result;
- }
-
public function setUp()
{
$this->args = argParser::getArgs();
@@ -50,53 +16,15 @@ class DemoFilesTest extends PHPUnit_Framework_TestCase
$this->coverageScriptUrl = 'http://' . $this->args['LOCALSERVER'] . '/' . str_replace( '/demo/server/server.php', 'tests/phpunit_coverage.php', $this->args['URI'] );
}
- protected function request($file, $method = 'GET', $payload = '')
- {
- $url = $this->baseUrl . $file;
-
- $ch = curl_init($url);
- curl_setopt_array($ch, array(
- CURLOPT_RETURNTRANSFER => true,
- CURLOPT_FAILONERROR => true
- ));
- if ($method == 'POST')
- {
- curl_setopt_array($ch, array(
- CURLOPT_POST => true,
- CURLOPT_POSTFIELDS => $payload
- ));
- }
- if ($this->collectCodeCoverageInformation)
- {
- curl_setopt($ch, CURLOPT_COOKIE, 'PHPUNIT_SELENIUM_TEST_ID=true');
- }
- $page = curl_exec($ch);
- curl_close($ch);
-
- $this->assertNotFalse($page);
- $this->assertNotContains('Fatal error', $page);
-
- return $page;
- }
-
public function testAgeSort()
{
$page = $this->request('client/agesort.php');
}
- public function testClient()
+ public function testGetStateName()
{
- $page = $this->request('client/client.php');
-
- // we could test many more calls to the client demo, but the upstream server is gone anyway...
-
- $page = $this->request('client/client.php', 'POST', array('stateno' => '1'));
- }
-
- public function testComment()
- {
- $page = $this->request('client/comment.php');
- $page = $this->request('client/client.php', 'POST', array('storyid' => '1'));
+ $page = $this->request('client/getstatename.php');
+ $page = $this->request('client/getstatename.php', 'POST', array('stateno' => '1'));
}
public function testIntrospect()
@@ -107,8 +35,7 @@ class DemoFilesTest extends PHPUnit_Framework_TestCase
public function testMail()
{
$page = $this->request('client/mail.php');
- $page = $this->request('client/client.php', 'POST', array(
- 'server' => '',
+ $page = $this->request('client/mail.php', 'POST', array(
"mailto" => '',
"mailsub" => '',
"mailmsg" => '',
@@ -118,9 +45,9 @@ class DemoFilesTest extends PHPUnit_Framework_TestCase
));
}
- public function testSimpleCall()
+ public function testProxy()
{
- $page = $this->request('client/simple_call.php');
+ $page = $this->request('client/proxy.php', 'GET', null, true);
}
public function testWhich()
@@ -133,22 +60,17 @@ class DemoFilesTest extends PHPUnit_Framework_TestCase
$page = $this->request('client/wrap.php');
}
- public function testZopeTest()
- {
- $page = $this->request('client/zopetest.php');
- }
-
public function testDiscussServer()
{
$page = $this->request('server/discuss.php');
$this->assertContains('faultCode', $page);
- $this->assertContains('105', $page);
+ $this->assertRegexp('#10(5|3)#', $page);
}
public function testProxyServer()
{
$page = $this->request('server/proxy.php');
$this->assertContains('faultCode', $page);
- $this->assertContains('105', $page);
+ $this->assertRegexp('#10(5|3)#', $page);
}
}