Permalink
Browse files

gg

  • Loading branch information...
1 parent d42c3b7 commit 4e26acfd4acf63f763a8536b41c54dff0acdf3b9 @kaviththiranga committed Dec 14, 2012
Showing with 35 additions and 0 deletions.
  1. +35 −0 tests/suites/legacy/request/JRequestGetMethodTest.php
@@ -0,0 +1,35 @@
+<?php
+/**
+ * @package Joomla.UnitTest
+ * @subpackage Environment
+ *
+ * @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
+ * @license GNU General Public License version 2 or later; see LICENSE
+ */
+
+/**
+ * A unit test class for JRequest
+ */
+class JRequestTest_GetMethod extends PHPUnit_Framework_TestCase
+{
+
+ /**
+ * Clear the cache
+ */
+ function setUp() {
+ // Make sure the request hash is clean.
+ $GLOBALS['_JREQUEST'] = array();
+ }
+
+ /**
+ * @covers JRequest::getMethod
+ */
+ function testGetMethod()
+ {
+ $_SERVER['REQUEST_METHOD'] = 'post';
+ $this -> assertEquals('POST', JRequest::getMethod());
+ $_SERVER['REQUEST_METHOD'] = 'get';
+ $this -> assertEquals('GET', JRequest::getMethod());
+ }
+
+}

0 comments on commit 4e26acf

Please sign in to comment.