/** * Tests the JAccess::getActionsFromData method. * * @param string $data The XML string representing the actions. * @param string $xpath The XPath query to extract the action elements. * @param mixed $expected The expected array of actions. * @param string $msg The failure message. * * @return void * * @since 12.1 * @dataProvider casesGetActionsFromData */ public function testGetActionsFromData($data, $xpath, $expected, $msg) { $this->assertThat(JAccess::getActionsFromData($data, $xpath), $this->equalTo($expected), 'Line:' . __LINE__ . $msg); }
/** * Helper wrapper method for getActionsFromData * * @param string|SimpleXMLElement $data The XML string or an XML element. * @param string $xpath An optional xpath to search for the fields. * * @return boolean|array False if case of error or the list of actions available. * * @see JAccess::getActionsFromData() * @since 3.4 */ public function getActionsFromData($data, $xpath = '/access/section[@name=\'component\']/') { return JAccess::getActionsFromData($data, $xpath); }