diff --git a/src/NT/Drupal/Testing/PHPUnit/drupal_test_case.php b/src/NT/Drupal/Testing/PHPUnit/drupal_test_case.php index 133cdef..7a9035c 100644 --- a/src/NT/Drupal/Testing/PHPUnit/drupal_test_case.php +++ b/src/NT/Drupal/Testing/PHPUnit/drupal_test_case.php @@ -32,7 +32,6 @@ * *@runTestsInSeparateProcess *@preserveGlobalState disabled - */ abstract class DrupalTestCase extends TestCase { @@ -129,7 +128,7 @@ abstract class DrupalTestCase extends TestCase { protected $originalShutdownCallbacks = array(); /** - * HTTP authentication method + * HTTP authentication method. */ protected $httpauth_method = CURLAUTH_BASIC; @@ -170,6 +169,7 @@ public function run(TestResult $result = NULL) { * The message to display along with the assertion. * @param $group * The type of assertion - examples are "Browser", "PHP". + * * @return * TRUE. */ @@ -187,6 +187,7 @@ protected function pass($message = NULL, $group = 'Other') { * The type of assertion - examples are "Browser", "PHP". * @param $caller * The caller of the error. + * * @return * FALSE. */ @@ -243,6 +244,7 @@ protected function assertUrl($path, array $options = array(), $message = '', $gr * Message to display. * @param $group * The group this message belongs to, defaults to 'Other'. + * * @return * TRUE on pass, FALSE on fail. */ @@ -263,6 +265,7 @@ protected function assertRaw($raw, $message = '', $group = 'Other') { * Message to display. * @param $group * The group this message belongs to, defaults to 'Other'. + * * @return * TRUE on pass, FALSE on fail. */ @@ -284,6 +287,7 @@ protected function assertNoRaw($raw, $message = '', $group = 'Other') { * Message to display. * @param $group * The group this message belongs to, defaults to 'Other'. + * * @return * TRUE on pass, FALSE on fail. */ @@ -302,6 +306,7 @@ protected function assertText($text, $message = '', $group = 'Other') { * Message to display. * @param $group * The group this message belongs to, defaults to 'Other'. + * * @return * TRUE on pass, FALSE on fail. */ @@ -322,6 +327,7 @@ protected function assertNoText($text, $message = '', $group = 'Other') { * The group this message belongs to. * @param $not_exists * TRUE if this text should not exist, FALSE if it should. + * * @return * TRUE on pass, FALSE on fail. */ @@ -348,6 +354,7 @@ protected function assertTextHelper($text, $message = '', $group, $not_exists) { * Message to display. * @param $group * The group this message belongs to, defaults to 'Other'. + * * @return * TRUE on pass, FALSE on fail. */ @@ -368,6 +375,7 @@ protected function assertUniqueText($text, $message = '', $group = 'Other') { * Message to display. * @param $group * The group this message belongs to, defaults to 'Other'. + * * @return * TRUE on pass, FALSE on fail. */ @@ -388,6 +396,7 @@ protected function assertNoUniqueText($text, $message = '', $group = 'Other') { * The group this message belongs to. * @param $be_unique * TRUE if this text should be found only once, FALSE if it should be found more than once. + * * @return * TRUE on pass, FALSE on fail. */ @@ -416,6 +425,7 @@ protected function assertUniqueTextHelper($text, $message = '', $group, $be_uniq * Message to display. * @param $group * The group this message belongs to. + * * @return * TRUE on pass, FALSE on fail. */ @@ -435,6 +445,7 @@ protected function assertPattern($pattern, $message = '', $group = 'Other') { * Message to display. * @param $group * The group this message belongs to. + * * @return * TRUE on pass, FALSE on fail. */ @@ -454,6 +465,7 @@ protected function assertNoPattern($pattern, $message = '', $group = 'Other') { * Message to display. * @param $group * The group this message belongs to. + * * @return * TRUE on pass, FALSE on fail. */ @@ -477,6 +489,7 @@ protected function assertTitle($title, $message = '', $group = 'Other') { * Message to display. * @param $group * The group this message belongs to. + * * @return * TRUE on pass, FALSE on fail. */ @@ -547,6 +560,7 @@ protected function assertFieldByXPath($xpath, $value = NULL, $message = '', $gro * * @param $element * SimpleXMLElement select element. + * * @return * The selected value or FALSE. */ @@ -608,6 +622,7 @@ protected function assertNoFieldByXPath($xpath, $value = NULL, $message = '', $g * Message to display. * @param $group * The group this message belongs to. + * * @return * TRUE on pass, FALSE on fail. */ @@ -626,6 +641,7 @@ protected function assertFieldByName($name, $value = '', $message = '') { * Message to display. * @param $group * The group this message belongs to. + * * @return * TRUE on pass, FALSE on fail. */ @@ -644,6 +660,7 @@ protected function assertNoFieldByName($name, $value = '', $message = '') { * Message to display. * @param $group * The group this message belongs to. + * * @return * TRUE on pass, FALSE on fail. */ @@ -662,6 +679,7 @@ protected function assertFieldById($id, $value = '', $message = '') { * Message to display. * @param $group * The group this message belongs to. + * * @return * TRUE on pass, FALSE on fail. */ @@ -676,6 +694,7 @@ protected function assertNoFieldById($id, $value = '', $message = '') { * Id of field to assert. * @param $message * Message to display. + * * @return * TRUE on pass, FALSE on fail. */ @@ -691,6 +710,7 @@ protected function assertFieldChecked($id, $message = '') { * Id of field to assert. * @param $message * Message to display. + * * @return * TRUE on pass, FALSE on fail. */ @@ -708,6 +728,7 @@ protected function assertNoFieldChecked($id, $message = '') { * Option to assert. * @param $message * Message to display. + * * @return * TRUE on pass, FALSE on fail. * @@ -727,6 +748,7 @@ protected function assertOptionSelected($id, $option, $message = '') { * Option to assert. * @param $message * Message to display. + * * @return * TRUE on pass, FALSE on fail. */ @@ -744,6 +766,7 @@ protected function assertNoOptionSelected($id, $option, $message = '') { * Message to display. * @param $group * The group this message belongs to. + * * @return * TRUE on pass, FALSE on fail. */ @@ -760,6 +783,7 @@ protected function assertField($field, $message = '', $group = 'Other') { * Message to display. * @param $group * The group this message belongs to. + * * @return * TRUE on pass, FALSE on fail. */ @@ -781,6 +805,7 @@ protected function assertNoField($field, $message = '', $group = 'Other') { * it should add a "todo" comment above the call to this function explaining * the legacy bug that the test wishes to ignore and including a link to an * issue that is working to fix that legacy bug. + * * @return * TRUE on pass, FALSE on fail. */ @@ -804,6 +829,7 @@ protected function assertNoDuplicateIds($message = '', $group = 'Other', $ids_to * Field attributes. * @param $value * Value of field. + * * @return * XPath for specified values. */ @@ -820,6 +846,7 @@ protected function constructFieldXpath($attribute, $value) { * of all codes see http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html. * @param $message * Message to display. + * * @return * Assertion result. */ @@ -928,6 +955,7 @@ protected function assertMailPattern($field_name, $regex, $message) { * Message to display. * @param $group * The group this message belongs to, defaults to 'Other'. + * * @return * TRUE if the assertion succeeded, FALSE otherwise. */ @@ -948,6 +976,7 @@ protected function assertLink($label, $index = 0, $message = '', $group = 'Other * Message to display. * @param $group * The group this message belongs to, defaults to 'Other'. + * * @return * TRUE if the assertion succeeded, FALSE otherwise. */ @@ -1006,6 +1035,7 @@ protected function assertNoLinkByHref($href, $message = '', $group = 'Other') { * * @param $length * Length of random string to generate. + * * @return * Randomly generated string. */ @@ -1028,6 +1058,7 @@ public static function randomString($length = 8) { * * @param $length * Length of random string to generate. + * * @return * Randomly generated string. */ @@ -1099,6 +1130,7 @@ public function verbose($message) { * * @param $permissions * Array of permission names to assign to user. + * * @return * A fully loaded user object with pass_raw property, or FALSE if account * creation fails. @@ -1136,6 +1168,7 @@ protected function drupalCreateUser($permissions = array('access comments', 'acc * Array of permission names to assign to role. * @param $name * (optional) String for the name of the role. Defaults to a random string. + * * @return * Role ID of newly created role, or FALSE if role creation failed. */ @@ -1177,6 +1210,7 @@ protected function drupalCreateRole(array $permissions, $name = NULL) { * @param $headers * An array containing additional HTTP request headers, each formatted as * "name: value". + * * @return * The retrieved HTML string, also available as $this->drupalGetContent() */ @@ -1419,7 +1453,7 @@ protected function drupalGetToken($value = '') { * $edit = array(...); * $this->drupalPost(NULL, $edit, t('Save')); * @endcode - * @param $edit + * @param $edit * Field data in an associative array. Changes the current input fields * (where possible) to the values indicated. A checkbox can be set to * TRUE to be checked and FALSE to be unchecked. Note that when a form @@ -1428,7 +1462,8 @@ protected function drupalGetToken($value = '') { * * Multiple select fields can be set using name[] and setting each of the * possible values. Example: - * @code + * + * @code * $edit = array(); * $edit['name[]'] = array('value1', 'value2'); * @endcode @@ -1562,6 +1597,7 @@ protected function drupalPost($path, $edit, $submit, array $options = array(), a * Permissions to check. * @param $reset * Reset cached available permissions. + * * @return * TRUE or FALSE depending on whether the permissions are valid. */ @@ -1653,6 +1689,7 @@ protected function drupalLogout() { * @param $settings * An associative array of settings to change from the defaults, keys are * node properties, for example 'title' => 'Hello, world!'. + * * @return * Created node object. */ @@ -1715,6 +1752,7 @@ protected function drupalCreateNode($settings = array()) { * @param $settings * An array of settings to change from the defaults. * Example: 'type' => 'foo'. + * * @return * Created content type. */ @@ -1773,6 +1811,7 @@ protected function drupalCreateContentType($settings = array()) { * Text between the anchor tags. * @param $index * Link position counting from zero. + * * @return * Page on success, or FALSE on failure. */ @@ -1797,6 +1836,7 @@ protected function clickLink($label, $index = 0) { * * @param $path * A path from the internal browser content. + * * @return * The $path with $base_url prepended, if necessary. */ @@ -1842,6 +1882,7 @@ protected function getUrl() { * @param $all_requests * Boolean value specifying whether to return headers from all requests * instead of just the last request. Defaults to FALSE. + * * @return * A name/value array if headers from only the last request are requested. * If headers from all requests are requested, an array of name/value @@ -1895,6 +1936,7 @@ protected function drupalGetHeaders($all_requests = FALSE) { * @param $all_requests * Boolean value specifying whether to check all requests if the header is * not found in the last request. Defaults to FALSE. + * * @return * The HTTP header value or FALSE if not found. */ @@ -1937,6 +1979,7 @@ protected function drupalGetSettings() { * * @param $filter * An array containing key/value pairs used to filter the e-mails that are returned. + * * @return * An array containing e-mail messages captured during the current test. */ @@ -1988,6 +2031,7 @@ protected function checkForMetaRefresh() { * @param $headers * An array containing additional HTTP request headers, each formatted as * "name: value". + * * @return * The retrieved headers, also available as $this->drupalGetContent() */ @@ -2011,6 +2055,7 @@ protected function drupalHead($path, array $options = array(), array $headers = * Form submit button value. * @param $form * Array of form elements. + * * @return * Submit value matches a valid submit input in the form. */ @@ -2160,6 +2205,7 @@ protected function handleForm(&$post, &$edit, &$upload, $submit, $form) { * An array of arguments with keys in the form ':name' matching the * placeholders in the query. The values may be either strings or numeric * values. + * * @return * An XPath query with arguments replaced. */ @@ -2192,6 +2238,7 @@ protected function buildXPathQuery($xpath, array $args = array()) { * * @param $xpath * The xpath string to use in the search. + * * @return * The return value of the xpath search. For details on the xpath string * format and return values see the SimpleXML documentation, @@ -2216,6 +2263,7 @@ protected function xpath($xpath, array $arguments = array()) { * * @param $element * The element for which to get the options. + * * @return * Option elements in select. */ diff --git a/src/NT/Drupal/Testing/PHPUnit/drupal_unit_test_case.php b/src/NT/Drupal/Testing/PHPUnit/drupal_unit_test_case.php index a78630e..e54db9b 100644 --- a/src/NT/Drupal/Testing/PHPUnit/drupal_unit_test_case.php +++ b/src/NT/Drupal/Testing/PHPUnit/drupal_unit_test_case.php @@ -6,7 +6,8 @@ * */ abstract class DrupalUnitTestCase extends DrupalTestCase { - /** @var int Current drupal run time level */ + /** + * @var int Current drupal run time level */ protected $drupal_level; public function setUp($bootstrap = DRUPAL_BOOTSTRAP_FULL, $file = UPAL_USE_DB) { diff --git a/src/NT/Drupal/Testing/PHPUnit/mink_drupal_test_case.php b/src/NT/Drupal/Testing/PHPUnit/mink_drupal_test_case.php index 97bec14..83303b7 100644 --- a/src/NT/Drupal/Testing/PHPUnit/mink_drupal_test_case.php +++ b/src/NT/Drupal/Testing/PHPUnit/mink_drupal_test_case.php @@ -30,13 +30,13 @@ /** * Mink TestCase. * - * @author Konstantin Kudryashov + * @author Konstantin Kudryashov */ abstract class MinkDrupalTestCase extends DrupalWebTestCase { /** * Mink instance. * - * @var Behat\Mink\Mink + * @var Behat\Mink\Mink */ private static $minkTestCaseMinkInstance; @@ -71,7 +71,7 @@ protected function tearDown() /** * Returns Mink instance. * - * @return Behat\Mink\Mink + * @return Behat\Mink\Mink */ public function getMink() { @@ -87,9 +87,9 @@ public function getMink() /** * Returns current Mink session. * - * @param string|null name of the session OR active session will be used + * @param string|null name of the session OR active session will be used * - * @return Behat\Mink\Session + * @return Behat\Mink\Session */ public function getSession($name = null) { @@ -109,7 +109,7 @@ public function takeScreenShot($path, $file = NULL) { /** * Registers Mink sessions on it's initialization. * - * @param Behat\Mink\Mink $mink Mink manager instance + * @param Behat\Mink\Mink $mink Mink manager instance */ protected static function registerMinkSessions(Mink $mink) { @@ -118,10 +118,10 @@ protected static function registerMinkSessions(Mink $mink) /** * Initizalizes and returns new GoutteDriver session. * - * @param array $zendConfig zend config parameters - * @param array $serverParameters server parameters + * @param array $zendConfig zend config parameters + * @param array $serverParameters server parameters * - * @return Behat\Mink\Session + * @return Behat\Mink\Session */ protected static function initGoutteSession(array $zendConfig = array(), array $serverParameters = array()) { @@ -133,12 +133,12 @@ protected static function initGoutteSession(array $zendConfig = array(), array $ /** * Initizalizes and returns new SahiDriver session. * - * @param string $browser browser name to use (default = firefox) - * @param array $sid sahi SID - * @param string $host sahi proxy host - * @param integer $port port number + * @param string $browser browser name to use (default = firefox) + * @param array $sid sahi SID + * @param string $host sahi proxy host + * @param integer $port port number * - * @return Behat\Mink\Session + * @return Behat\Mink\Session */ protected static function initSahiSession($browser = 'firefox', $sid = null, $host = 'localhost', $port = 9999) { @@ -148,12 +148,12 @@ protected static function initSahiSession($browser = 'firefox', $sid = null, $ho /** * Initizalizes and returns new ZombieDriver session. * - * @param string $host zombie.js server host - * @param integer $port port number - * @param Boolean $autoServer use bundled with driver server or manually started one - * @param string $nodeBin path to node binary + * @param string $host zombie.js server host + * @param integer $port port number + * @param Boolean $autoServer use bundled with driver server or manually started one + * @param string $nodeBin path to node binary * - * @return Behat\Mink\Session + * @return Behat\Mink\Session */ protected static function initZombieSession($host = '127.0.0.1', $port = 8124, $autoServer = true, $nodeBin = 'node') @@ -167,12 +167,12 @@ protected static function initZombieSession($host = '127.0.0.1', $port = 8124, /** * Initizalizes and returns new SeleniumDriver session. * - * @param string $browser browser info - * @param string $baseUrl selenium start url - * @param string $host selenium server server host - * @param integer $port port number + * @param string $browser browser info + * @param string $baseUrl selenium start url + * @param string $host selenium server server host + * @param integer $port port number * - * @return Behat\Mink\Session + * @return Behat\Mink\Session */ protected static function initSeleniumSession($browser = '*firefox', $baseUrl = 'http://localhost', @@ -184,10 +184,10 @@ protected static function initSeleniumSession($browser = '*firefox', /** * Initizalizes and returns new Selenium2Driver session. * - * @param string $browser browser name - * @param string $host selenium server server host + * @param string $browser browser name + * @param string $host selenium server server host * - * @return Behat\Mink\Session + * @return Behat\Mink\Session */ protected static function initWebdriverSession($browser = 'firefox', $desiredCapabilities = NULL, diff --git a/src/NT/Drupal/Testing/PHPUnit/nt_mink_drupal_test_case.php b/src/NT/Drupal/Testing/PHPUnit/nt_mink_drupal_test_case.php index 7fc6881..a7a5f47 100644 --- a/src/NT/Drupal/Testing/PHPUnit/nt_mink_drupal_test_case.php +++ b/src/NT/Drupal/Testing/PHPUnit/nt_mink_drupal_test_case.php @@ -5,7 +5,7 @@ use Behat\Mink\Driver\Selenium2Driver; /** - * Description of bbpa_mink_drupal_test_case + * Description of bbpa_mink_drupal_test_case. */ abstract class NtMinkDrupalTestCase extends MinkDrupalTestCase { @@ -183,7 +183,8 @@ protected function loadPlaywright(array $config) { /** * #edit-bbpa-item-grouping-und-none, #edit-bbpa-item-grouping-und-fnt-video, #edit-bbpa-item-grouping-und-fnt-also - * #edit-bbpa-item-grouping-und-browse, #edit-bbpa-item-grouping-und-featured-cont + * #edit-bbpa-item-grouping-und-browse, #edit-bbpa-item-grouping-und-featured-cont. + * * @param array $config */ protected function loadFeaturedItem(array $config) {