Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Coverage for RESTConfiguration and RESTMethod

  • Loading branch information...
commit 73066f4709d25f586351a1f030af1e7002dfd7da 1 parent a5d26a5
@dluc dluc authored
View
41 tests/configuration/restConfigurationTest.php
@@ -0,0 +1,41 @@
+<?php
+
+/**
+ * Test RESTConfiguration class
+ *
+ * @author Devis Lucato <devis@lucato.it>
+ */
+
+require_once(MASHAPE_LIBRAY_PATH . "/configuration/restConfiguration.php");
+
+class RESTConfigurationTest extends PHPUnit_Framework_TestCase
+{
+ protected $_instance;
+
+ public function setUp()
+ {
+ $this->_instance = new RESTConfiguration();
+ }
+
+ /**
+ * @covers RESTConfiguration::setMethods
+ * @covers RESTConfiguration::getMethods
+ */
+ public function test_setMethods_and_getMethods()
+ {
+ $value = __METHOD__ . time();
+ $this->_instance->setMethods($value);
+ $this->assertEquals($value, $this->_instance->getMethods());
+ }
+
+ /**
+ * @covers RESTConfiguration::setObjects
+ * @covers RESTConfiguration::getObjects
+ */
+ public function test_setObjects_and_getObjects()
+ {
+ $value = __METHOD__ . time();
+ $this->_instance->setObjects($value);
+ $this->assertEquals($value, $this->_instance->getObjects());
+ }
+}
View
86 tests/configuration/restMethodTest.php
@@ -0,0 +1,86 @@
+<?php
+
+/**
+ * Test RESTMethod class
+ *
+ * @author Devis Lucato <devis@lucato.it>
+ */
+
+require_once(MASHAPE_LIBRAY_PATH . "/configuration/restMethod.php");
+
+class RESTMethodTest extends PHPUnit_Framework_TestCase
+{
+ protected $_instance;
+
+ public function setUp()
+ {
+ $this->_instance = new RESTMethod();
+ }
+
+ /**
+ * @covers RESTMethod::setResult
+ * @covers RESTMethod::getResult
+ */
+ public function test_setResult_and_getResult()
+ {
+ $value = __METHOD__ . time();
+ $this->_instance->setResult($value);
+ $this->assertEquals($value, $this->_instance->getResult());
+ }
+
+ /**
+ * @covers RESTMethod::setObject
+ * @covers RESTMethod::getObject
+ */
+ public function test_setObject_and_getObject()
+ {
+ $value = __METHOD__ . time();
+ $this->_instance->setObject($value);
+ $this->assertEquals($value, $this->_instance->getObject());
+ }
+
+ /**
+ * @covers RESTMethod::setName
+ * @covers RESTMethod::getName
+ */
+ public function test_setName_and_getName()
+ {
+ $value = __METHOD__ . time();
+ $this->_instance->setName($value);
+ $this->assertEquals($value, $this->_instance->getName());
+ }
+
+ /**
+ * @covers RESTMethod::setHttp
+ * @covers RESTMethod::getHttp
+ */
+ public function test_setHttp_and_getHttp()
+ {
+ $value = __METHOD__ . time();
+ $this->_instance->setHttp($value);
+ $this->assertEquals($value, $this->_instance->getHttp());
+ }
+
+ /**
+ * @covers RESTMethod::setRoute
+ * @covers RESTMethod::getRoute
+ */
+ public function test_setRoute_and_getRoute()
+ {
+ $value = __METHOD__ . time();
+ $this->_instance->setRoute($value);
+ $this->assertEquals($value, $this->_instance->getRoute());
+ }
+
+ /**
+ * @covers RESTMethod::setArray
+ * @covers RESTMethod::isArray
+ */
+ public function test_setArray_and_isArray()
+ {
+ $this->markTestSkipped('isArray() implementation does not verify if the value is an array');
+ $value = __METHOD__ . time();
+ $this->_instance->setArray($value);
+ $this->assertEquals($value, $this->_instance->isArray());
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.