/tests/unit/stubs/FormInspectors.php

https://github.com/dextercowley/joomla-cms · PHP · 293 lines · 98 code · 22 blank · 173 comment · 2 complexity · 3705f84a982d8c4636b5ee1bc7986127 MD5 · raw file

  1. <?php
  2. /**
  3. * @package Joomla.UnitTest
  4. * @subpackage Form
  5. *
  6. * @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
  7. * @license GNU General Public License version 2 or later; see LICENSE
  8. */
  9. /**
  10. * Inspector classes for the forms library.
  11. */
  12. /**
  13. * JFormInspector class.
  14. *
  15. * @package Joomla.UnitTest
  16. * @subpackage Form
  17. *
  18. * @since 11.1
  19. */
  20. class JFormInspector extends JForm
  21. {
  22. /**
  23. * Test...
  24. *
  25. * @param SimpleXMLElement $source @todo
  26. * @param SimpleXMLElement $new @todo
  27. *
  28. * @return void
  29. */
  30. public static function addNode(SimpleXMLElement $source, SimpleXMLElement $new)
  31. {
  32. return parent::addNode($source, $new);
  33. }
  34. /**
  35. * Test...
  36. *
  37. * @param SimpleXMLElement $source @todo
  38. * @param SimpleXMLElement $new @todo
  39. *
  40. * @return void
  41. */
  42. public static function mergeNode(SimpleXMLElement $source, SimpleXMLElement $new)
  43. {
  44. return parent::mergeNode($source, $new);
  45. }
  46. /**
  47. * Test...
  48. *
  49. * @param SimpleXMLElement $source @todo
  50. * @param SimpleXMLElement $new @todo
  51. *
  52. * @return void
  53. */
  54. public static function mergeNodes(SimpleXMLElement $source, SimpleXMLElement $new)
  55. {
  56. return parent::mergeNodes($source, $new);
  57. }
  58. /**
  59. * Test...
  60. *
  61. * @param string $element @todo
  62. * @param mixed $value @todo
  63. *
  64. * @return void
  65. */
  66. public function filterField($element, $value)
  67. {
  68. return parent::filterField($element, $value);
  69. }
  70. /**
  71. * Test...
  72. *
  73. * @param string $name @todo
  74. * @param null $group @todo
  75. *
  76. * @return void
  77. */
  78. public function findField($name, $group = null)
  79. {
  80. return parent::findField($name, $group);
  81. }
  82. /**
  83. * Test...
  84. *
  85. * @param string $group @todo
  86. *
  87. * @return void
  88. */
  89. public function findGroup($group)
  90. {
  91. return parent::findGroup($group);
  92. }
  93. /**
  94. * Test...
  95. *
  96. * @param null $group @todo
  97. * @param bool $nested @todo
  98. *
  99. * @return void
  100. */
  101. public function findFieldsByGroup($group = null, $nested = false)
  102. {
  103. return parent::findFieldsByGroup($group, $nested);
  104. }
  105. /**
  106. * Test...
  107. *
  108. * @param string $name @todo
  109. *
  110. * @return void
  111. */
  112. public function findFieldsByFieldset($name)
  113. {
  114. return parent::findFieldsByFieldset($name);
  115. }
  116. /**
  117. * Test...
  118. *
  119. * @return void
  120. */
  121. public function getData()
  122. {
  123. return $this->data;
  124. }
  125. /**
  126. * Test...
  127. *
  128. * @return array Return the protected options array.
  129. */
  130. public function getOptions()
  131. {
  132. return $this->options;
  133. }
  134. /**
  135. * Test...
  136. *
  137. * @return string
  138. */
  139. public function getXML()
  140. {
  141. return $this->xml;
  142. }
  143. /**
  144. * Test...
  145. *
  146. * @param string $element @todo
  147. * @param null $group @todo
  148. * @param null $value @todo
  149. *
  150. * @return JFormField
  151. */
  152. public function loadField($element, $group = null, $value = null)
  153. {
  154. return parent::loadField($element, $group, $value);
  155. }
  156. /**
  157. * Test...
  158. *
  159. * @param string $type @todo
  160. * @param bool $new @todo
  161. *
  162. * @return JFormField
  163. */
  164. public function loadFieldType($type, $new = true)
  165. {
  166. return parent::loadFieldType($type, $new);
  167. }
  168. /**
  169. * Test...
  170. *
  171. * @param string $type @todo
  172. * @param bool $new @todo
  173. *
  174. * @return JFormRule
  175. */
  176. public function loadRuleType($type, $new = true)
  177. {
  178. return parent::loadRuleType($type, $new);
  179. }
  180. /**
  181. * Test...
  182. *
  183. * @param SimpleXMLElement $element @todo
  184. * @param null $group @todo
  185. * @param null $value @todo
  186. * @param null $input @todo
  187. *
  188. * @return boolean
  189. */
  190. public function validateField($element, $group = null, $value = null, $input = null)
  191. {
  192. return parent::validateField($element, $group, $value, $input);
  193. }
  194. }
  195. /**
  196. * JFormFieldInspector class.
  197. *
  198. * @package Joomla.UnitTest
  199. * @subpackage Form
  200. *
  201. * @since 11.1
  202. */
  203. class JFormFieldInspector extends JFormField
  204. {
  205. /**
  206. * Test...
  207. *
  208. * @param string $name Element name
  209. *
  210. * @return mixed
  211. */
  212. public function __get($name)
  213. {
  214. if ($name == 'element')
  215. {
  216. return $this->element;
  217. }
  218. else
  219. {
  220. return parent::__get($name);
  221. }
  222. }
  223. /**
  224. * Test...
  225. *
  226. * @return void
  227. */
  228. public function getInput()
  229. {
  230. return null;
  231. }
  232. /**
  233. * Test...
  234. *
  235. * @return JForm
  236. */
  237. public function getForm()
  238. {
  239. return $this->form;
  240. }
  241. /**
  242. * Test...
  243. *
  244. * @param string $fieldId Field id
  245. * @param string $fieldName Field name
  246. *
  247. * @return string
  248. */
  249. public function getId($fieldId, $fieldName)
  250. {
  251. return parent::getId($fieldId, $fieldName);
  252. }
  253. /**
  254. * Test...
  255. *
  256. * @return string
  257. */
  258. public function getLabel()
  259. {
  260. return parent::getLabel();
  261. }
  262. /**
  263. * Test...
  264. *
  265. * @return string
  266. */
  267. public function getTitle()
  268. {
  269. return parent::getTitle();
  270. }
  271. }