Added tests
git-svn-id: https://svn.apache.org/repos/asf/chemistry/phpclient/trunk@1499200 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/test/atom/AlfrescoH2CMISTest.php b/test/atom/AlfrescoH2CMISTest.php
index 861e79f..2e88136 100644
--- a/test/atom/AlfrescoH2CMISTest.php
+++ b/test/atom/AlfrescoH2CMISTest.php
@@ -1,4 +1,10 @@
<?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 AlfrescoCMISH2Test extends PHPUnit_Framework_TestCase
@@ -10,10 +16,20 @@
$repo_password = "admin";
$this->client = new CMISService($repo_url, $repo_username, $repo_password);
}
- public function testGetSites() {
+ public function testGetFolder() {
+ /*
+ * This test gets an known folder and tests the ability to retreive know properties
+ */
$folder = $this->client->getObjectByPath("/Sites");
$this->assertEquals("F:st:sites",$folder->properties["cmis:objectTypeId"]);
$this->assertEquals("cmis:folder",$folder->properties["cmis:baseTypeId"]);
}
+ /**
+ * @expectedException CmisObjectNotFoundException
+ */
+ public function testInvalidCreateFolder() {
+ $folder = $this->client->getObjectByPath("/x");
+ $folder = $this->client->createFolder($folder->id,"TEST");
+ }
}
?>