summaryrefslogtreecommitdiff
path: root/tests/simple_unit/Soap/SoapTestCase.php
diff options
context:
space:
mode:
authorFabio Bas <ctrlaltca@gmail.com>2016-03-25 17:55:51 +0100
committerFabio Bas <ctrlaltca@gmail.com>2016-03-25 17:55:51 +0100
commita3388622287e218beddfa14a47ed677d4307b36b (patch)
tree1b4c7ac8597b1cc798b6683d4a81c90d38de12f6 /tests/simple_unit/Soap/SoapTestCase.php
parentc7fd3e1167b6f2fa7746edbd0fb8f8c1694c61f9 (diff)
Removed simpletest and moved all tests in the unit tree
Tests are executed now, but a lot of them need fixing.
Diffstat (limited to 'tests/simple_unit/Soap/SoapTestCase.php')
-rw-r--r--tests/simple_unit/Soap/SoapTestCase.php90
1 files changed, 0 insertions, 90 deletions
diff --git a/tests/simple_unit/Soap/SoapTestCase.php b/tests/simple_unit/Soap/SoapTestCase.php
deleted file mode 100644
index 3aaa60d3..00000000
--- a/tests/simple_unit/Soap/SoapTestCase.php
+++ /dev/null
@@ -1,90 +0,0 @@
-<?php
-
-ini_set("soap.wsdl_cache_enabled",0);
-
-require_once(dirname(__FILE__).'/ContactManager.php');
-
-class SoapTestCase extends UnitTestCase
-{
- function getWsdlUri()
- {
- $script = str_replace('unit.php', 'ws.php',$_SERVER['SCRIPT_NAME']);
- return "http://".$_SERVER['HTTP_HOST'].$script.'?soap=contacts.wsdl';
- }
-
- function getClient()
- {
- return new SoapClient($this->getWsdlUri());
- }
-
- function testContactArray()
- {
- $result = $this->getClient()->getContacts();
- $this->assertEqual(count($result), 1);
- $obj = $result->Contact;
- $this->assertEqual($obj->name, "me");
- $this->assertEqual($obj->id, 1);
- $this->assertEqual($obj->address->street, "sesamstreet");
- $this->assertNull($obj->address->nr);
- $this->assertNull($obj->address->zipcode);
- $this->assertEqual($obj->address->city, "sesamcity");
- $this->assertEqual($obj->email, "me@you.com");
- }
-
- function testGetContactThrowsException()
- {
- try
- {
- $result = $this->getClient()->getContact(1);
- $this->fail();
- }
- catch (SoapFault $f)
- {
- $this->pass();
- }
- }
-
- function testGetNewContact()
- {
- $obj = $this->getClient()->newContact();
- $this->assertNull($obj->name);
- $this->assertNull($obj->id);
- $this->assertNull($obj->address);
- $this->assertNull($obj->email);
- }
-
- function testSaveContactReturnsTrue()
- {
- $c = new Contact;
- $result = $this->getClient()->saveContact($c);
- $this->assertTrue($result);
- }
-
- function getMixedArray()
- {
- $result = $this->getClient()>getList();
- $expected = array(array(1,2), array("12", 1.2));
- $this->assertEqual($result, $expected);
- }
-
- function testEmptyArray()
- {
- $result = $this->getClient()->getEmptyArray();
- $this->assertTrue(is_array($result));
- $this->assertEqual(count($result), 0);
- }
-
- function testUnknownFunctionThrowsException()
- {
- try
- {
- $this->getClient()->test();
- $this->fail();
- }
- catch (SoapFault $f)
- {
- $this->pass();
- }
- }
-}
-