Update TEsts fix problem with CMisNotIMplemented exceptions




git-svn-id: https://svn.apache.org/repos/asf/chemistry/phpclient/trunk@1499220 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/atom/cmis/cmis_service.php b/atom/cmis/cmis_service.php
index 8a45003..0443dac 100644
--- a/atom/cmis/cmis_service.php
+++ b/atom/cmis/cmis_service.php
@@ -263,7 +263,7 @@
 	 * @since CMIS-1.0
 	 */
 	function getRepositories() {
-		throw CmisNotImplementedException("getRepositories");
+		throw new CmisNotImplementedException("getRepositories");
 	}
 
 	/**
@@ -375,7 +375,7 @@
 	 * @since CMIS-1.1
 	 */
 	function createType($objectType) {
-		throw CmisNotImplementedException("createType");		
+		throw new CmisNotImplementedException("createType");		
 	}
 
 	/**
@@ -390,7 +390,7 @@
 	 * @since CMIS-1.1
 	 */
 	function updateType($objectType) {
-		throw CmisNotImplementedException("updateType");		
+		throw new CmisNotImplementedException("updateType");		
 	}
 
 	/**
@@ -403,7 +403,7 @@
 	 * @since CMIS-1.1
 	 */
 	function deleteType($typeId) {
-		throw CmisNotImplementedException("deleteType");		
+		throw new CmisNotImplementedException("deleteType");		
 	}
 	//Navigation Services
 	/**
@@ -962,15 +962,15 @@
 	}
 
 	function createRelationship() { // Not in first Release
-		throw CmisNotImplementedException("createRelationship");
+		throw new CmisNotImplementedException("createRelationship");
 	}
 
 	function createPolicy() { // Not in first Release
-		throw CmisNotImplementedException("createPolicy");
+		throw new CmisNotImplementedException("createPolicy");
 	}
 	
 	function createItem() {
-		throw CmisNotImplementedException("createItem");
+		throw new CmisNotImplementedException("createItem");
 	}
 
 	function updateProperties($objectId, $properties = array (), $options = array ()) { // Yes
@@ -1017,7 +1017,7 @@
 	
 	// New for 1.1
 	function bulkUpdateProperties() {
-		throw CmisNotImplementedException("bulkUpdateProperties");		
+		throw new CmisNotImplementedException("bulkUpdateProperties");		
 	}
 
 	function moveObject($objectId, $targetFolderId, $sourceFolderId, $options = array ()) { //yes
@@ -1088,7 +1088,7 @@
 	 * @since CMIS-1.0
 	 */
 	function appendContentStream($objectId, $content, $content_type, $options = array ()) { //Yes
-		throw CmisNotImplementedException("appendContentStream");
+		throw new CmisNotImplementedException("appendContentStream");
 	}
 
 	/**
@@ -1120,7 +1120,7 @@
 	}
 
 	function getAllVersions() {
-		throw CmisNotImplementedException("getAllVersions");
+		throw new CmisNotImplementedException("getAllVersions");
 	}
 
 	/**
@@ -1179,14 +1179,14 @@
 	}
 
 	function deleteAllVersions() {
-		throw CmisNotImplementedException("deleteAllVersions");
+		throw new CmisNotImplementedException("deleteAllVersions");
 	}
 
 	//Relationship Services
 	function getObjectRelationships() {
 		// get stripped down version of object (for the links) and then get the relationships?
 		// Low priority -- can get all information when getting object
-		throw CmisNotImplementedException("getObjectRelationships");
+		throw new CmisNotImplementedException("getObjectRelationships");
 	}
 
 	//Multi-Filing ServicesRelation
@@ -1208,23 +1208,23 @@
 
 	//Policy Services
 	function getAppliedPolicies() {
-		throw CmisNotImplementedException("getAppliedPolicies");
+		throw new CmisNotImplementedException("getAppliedPolicies");
 	}
 
 	function applyPolicy() {
-		throw CmisNotImplementedException("applyPolicy");
+		throw new CmisNotImplementedException("applyPolicy");
 	}
 
 	function removePolicy() {
-		throw CmisNotImplementedException("removePolicy");
+		throw new CmisNotImplementedException("removePolicy");
 	}
 
 	//ACL Services
 	function getACL() {
-		throw CmisNotImplementedException("getACL");
+		throw new CmisNotImplementedException("getACL");
 	}
 
 	function applyACL() {
-		throw CmisNotImplementedException("applyACL");
+		throw new CmisNotImplementedException("applyACL");
 	}
 }
\ No newline at end of file
diff --git a/test/atom/AlfrescoH2CMISTest.php b/test/atom/AlfrescoH2CMISTest.php
index 2e88136..0f16b14 100644
--- a/test/atom/AlfrescoH2CMISTest.php
+++ b/test/atom/AlfrescoH2CMISTest.php
@@ -31,5 +31,4 @@
 		$folder = $this->client->getObjectByPath("/x");
 		$folder = $this->client->createFolder($folder->id,"TEST");
 	}
-}
-?>
+}
\ No newline at end of file
diff --git a/test/atom/NotImplementedTest.php b/test/atom/NotImplementedTest.php
new file mode 100644
index 0000000..16bf039
--- /dev/null
+++ b/test/atom/NotImplementedTest.php
@@ -0,0 +1,146 @@
+<?php
+/*
+
+This set of tests are designed to run against an clean (new) Alfresco repository
+The easiest way to run this would be to have a repository that uses an H2 database (for easy reseting)
+
+*/
+require_once('../utils/phpunit.phar');
+require_once('../../atom/cmis-lib.php');
+class NotImplementedTest extends PHPUnit_Framework_TestCase
+{
+	protected $client;
+	protected function setUp() {
+		$repo_url = "http://localhost:8080/alfresco/cmisatom";
+		$repo_username = "admin";
+		$repo_password = "admin";
+		$this->client = new CMISService($repo_url, $repo_username, $repo_password);
+	}
+	/**
+	 * @expectedException CmisNotImplementedException
+	 * @expectedExceptionMessage getRepositories
+	 */
+	public function testGetRepositories() {
+		$this->client->getRepositories();
+	}
+	
+	/**
+	 * @expectedException CmisNotImplementedException
+	 * @expectedExceptionMessage createType
+	 */
+	public function testCreateType() {
+		$this->client->createType("");
+	}
+
+	/**
+	 * @expectedException CmisNotImplementedException
+	 * @expectedExceptionMessage updateType
+	 */
+	public function testUpdateType() {
+		$this->client->updateType("");
+	}
+	/**
+	 * @expectedException CmisNotImplementedException
+	 * @expectedExceptionMessage deleteType
+	 */
+	public function testDeleteType() {
+		$this->client->deleteType("");
+	}
+	/**
+	 * @expectedException CmisNotImplementedException
+	 * @expectedExceptionMessage createRelationship
+	 */
+	public function testCreateRelationship() {
+		$this->client->createRelationship();
+	}
+
+	/**
+	 * @expectedException CmisNotImplementedException
+	 * @expectedExceptionMessage createPolicy
+	 */
+	public function testCreatePolicy() {
+		$this->client->createPolicy();
+	}
+	/**
+	 * @expectedException CmisNotImplementedException
+	 * @expectedExceptionMessage createItem
+	 */
+	public function testCreateItem() {
+		$this->client->createItem();
+	}
+	/**
+	 * @expectedException CmisNotImplementedException
+	 * @expectedExceptionMessage bulkUpdateProperties
+	 */
+	public function testBulkUpdateProperties() {
+		$this->client->bulkUpdateProperties();
+	}
+	
+	/**
+	 * @expectedException CmisNotImplementedException
+	 * @expectedExceptionMessage appendContentStream
+	 */
+	public function testAppendContentStream() {
+		$this->client->appendContentStream("","","","");
+	}
+
+	/**
+	 * @expectedException CmisNotImplementedException
+	 * @expectedExceptionMessage getAllVersions
+	 */
+	public function testGetAllVersions() {
+		$this->client->getAllVersions("");
+	}
+	/**
+	 * @expectedException CmisNotImplementedException
+	 * @expectedExceptionMessage deleteAllVersions
+	 */
+	public function testDeleteAllVersions() {
+		$this->client->deleteAllVersions("");
+	}
+	/**
+	 * @expectedException CmisNotImplementedException
+	 * @expectedExceptionMessage getObjectRelationships
+	 */
+	public function testGetObjectRelationships() {
+		$this->client->getObjectRelationships();
+	}
+
+	/**
+	 * @expectedException CmisNotImplementedException
+	 * @expectedExceptionMessage getAppliedPolicies
+	 */
+	public function testGetAppliedPolicies() {
+		$this->client->getAppliedPolicies();
+	}
+	/**
+	 * @expectedException CmisNotImplementedException
+	 * @expectedExceptionMessage applyPolicy
+	 */
+	public function testApplyPolicy() {
+		$this->client->applyPolicy();
+	}
+	/**
+	 * @expectedException CmisNotImplementedException
+	 * @expectedExceptionMessage removePolicy
+	 */
+	public function testRemovePolicy() {
+		$this->client->removePolicy();
+	}
+
+	/**
+	 * @expectedException CmisNotImplementedException
+	 * @expectedExceptionMessage getACL
+	 */
+	public function testGetACL() {
+		$this->client->getACL();
+	}
+	/**
+	 * @expectedException CmisNotImplementedException
+	 * @expectedExceptionMessage applyACL
+	 */
+	public function testApplyACL() {
+		$this->client->applyACL();
+	}
+
+}
\ No newline at end of file