Skip to content

Commit

Permalink
Applies Drupal.Commenting.InlineComment sniff
Browse files Browse the repository at this point in the history
  • Loading branch information
kenorb committed Mar 26, 2018
1 parent 8c950c1 commit c4866e4
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 39 deletions.
2 changes: 1 addition & 1 deletion src/NT/Drupal/Testing/Context/NTDrupalContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class NTDrupalContext extends DrupalContext {
* context parameters (set them up through behat.yml)
*/
public function __construct(array $parameters) {
// Initialize your context here
// Initialize your context here.
if (!defined('UPAL_ROOT')) {
define('UPAL_ROOT', $parameters['UPAL_ROOT']);
}
Expand Down
1 change: 0 additions & 1 deletion src/NT/Drupal/Testing/Fixtures/fixtures.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ protected function install_node($node) {
unset($node->vid);
unset($node->path);
$node->path['pathauto'] = 1;
//var_dump($node->type);
$this->dependanices($node);
node_save($node);
return $node->nid;
Expand Down
26 changes: 3 additions & 23 deletions src/NT/Drupal/Testing/PHPUnit/drupal_test_case.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,19 +175,6 @@ protected function pass($message = NULL, $group = 'Other') {
return $this->assertTrue(TRUE, $message, $group);
}

/**
* Fire an assertion that is always negative.
*
* @param $message
* The message to display along with the assertion.
* @param $group
* The type of assertion - examples are "Browser", "PHP".
* @return
* FALSE.
*/
//protected function fail($message = NULL, $group = 'Other') {
// return $this->assertTrue(FALSE, $message, $group);
//}

/**
* Fire an error assertion.
Expand Down Expand Up @@ -1102,9 +1089,6 @@ public static function generatePermutations($parameters) {
}

public function verbose($message) {
if (strlen($message) < 500) {
// $this->log($message, 'verbose');
}
}

/**
Expand Down Expand Up @@ -1247,9 +1231,9 @@ protected function curlInitialize() {
}
// We set the user agent header on each request so as to use the current
// time and a new uniqid.
//if (preg_match('/simpletest\d+/', $this->databasePrefix, $matches)) {
// if (preg_match('/simpletest\d+/', $this->databasePrefix, $matches)) {
// curl_setopt($this->curlHandle, CURLOPT_USERAGENT, drupal_generate_test_ua($matches[0]));
//}
// }
}

/**
Expand Down Expand Up @@ -1639,7 +1623,7 @@ protected function drupalLogin(stdClass $user) {
$pass = $this->assertLink(t('Log out'), 0, t('User %name successfully logged in.', array('%name' => $user->name)), t('User login'));

if (1 || $pass) {
// TODO: declare this var
// @todo: declare this var.
$this->loggedInUser = $user;
}
}
Expand Down Expand Up @@ -2401,8 +2385,4 @@ public static function import_database($database, $file) {
exec($cmd, $output, $return);
print 'Import finished took:' . (time() - $time) . "sec\n\n";
}
// function db_url($env) {
// return substr(UPAL_DB_URL, 0, 6) == 'sqlite' ? "sqlite://sites/$env/files/unish.sqlite" : UPAL_DB_URL . '/unish_' . $env;
// }

}
1 change: 0 additions & 1 deletion src/NT/Drupal/Testing/PHPUnit/drupal_web_test_case.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ public function setUp() {
// Reset cached schema for new database prefix. This must be done before
// drupal_flush_all_caches() so rebuilds can make use of the schema of
// modules enabled on the cURL side.

$connection_info = \Database::getConnectionInfo('default');
\Database::removeConnection('default');
$connection_info['default']['prefix'] = $this->prefix . '_';
Expand Down
18 changes: 9 additions & 9 deletions src/NT/Drupal/Testing/PHPUnit/nt_mink_drupal_test_case.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ protected function loadProduction(array $config) {
$el = $page->find('css', '#edit-submit');
$el->press();

$this->getSession()->wait(3000); // wait a 3 second
$this->getSession()->wait(3000); // Wait a 3 second.
}

protected function loadTheatre(array $config) {
Expand All @@ -107,7 +107,7 @@ protected function loadTheatre(array $config) {
$el = $page->find('css', '#edit-submit');
$el->press();

$this->getSession()->wait(3000); // wait a 3 second
$this->getSession()->wait(3000); // Wait a 3 second.
}

protected function loadCompany(array $config) {
Expand All @@ -128,7 +128,7 @@ protected function loadCompany(array $config) {
$el = $page->find('css', '#edit-submit');
$el->press();

$this->getSession()->wait(3000); // wait a 3 second
$this->getSession()->wait(3000); // Wait a 3 second.
}


Expand Down Expand Up @@ -181,7 +181,7 @@ protected function loadPlaywright(array $config) {
$el = $page->find('css', '#edit-submit');
$el->press();

$this->getSession()->wait(3000); // wait a 3 second
$this->getSession()->wait(3000); // Wait a 3 second.
}


Expand Down Expand Up @@ -226,7 +226,7 @@ protected function loadFeaturedItem(array $config) {
$el = $page->find('css', '#edit-submit');
$el->press();

$this->getSession()->wait(3000); // wait a 3 second
$this->getSession()->wait(3000); // Wait a 3 second.
}

protected function loadArticle(array $config) {
Expand Down Expand Up @@ -260,7 +260,7 @@ protected function loadArticle(array $config) {
$el = $page->find('css', '#edit-submit');
$el->press();

$this->getSession()->wait(3000); // wait a 3 second
$this->getSession()->wait(3000); // Wait a 3 second.
}

protected function loadImage(array $config) {
Expand Down Expand Up @@ -294,7 +294,7 @@ protected function loadImage(array $config) {
$el = $page->find('css', '#edit-submit');
$el->press();

$this->getSession()->wait(3000, "$('.messages.status').length > 0"); // wait a 3 second
$this->getSession()->wait(3000, "$('.messages.status').length > 0"); // Wait a 3 second.
}

protected function loadVideo(array $config) {
Expand Down Expand Up @@ -336,7 +336,7 @@ protected function loadVideo(array $config) {
$el = $page->find('css', '#edit-submit');
$el->press();

$this->getSession()->wait(3000); // wait a 3 second
$this->getSession()->wait(3000); // Wait a 3 second.
}


Expand Down Expand Up @@ -364,7 +364,7 @@ protected function login() {
$el->setValue('test1234');
$el = $page->find('css', '#edit-submit');
$el->press();
$this->getSession()->wait(3000); // wait a 3 second
$this->getSession()->wait(3000); // Wait a 3 second.
}

}
Expand Down
4 changes: 0 additions & 4 deletions src/NT/Drupal/Testing/PHPUnit/upal.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,12 @@ public static function init() {
if (!defined('UPAL_ROOT')) {
define('UPAL_ROOT', getenv('UPAL_ROOT') ? getenv('UPAL_ROOT') : (isset($GLOBALS['UPAL_ROOT']) ? $GLOBALS['UPAL_ROOT'] : realpath('.')));
}
//chdir(UPAL_ROOT);

// The URL that browser based tests should use.
if (!defined('UPAL_WEB_URL')) {
define('UPAL_WEB_URL', getenv('UPAL_WEB_URL') ? getenv('UPAL_WEB_URL') : (isset($GLOBALS['UPAL_WEB_URL']) ? $GLOBALS['UPAL_WEB_URL'] : 'http://upal'));
}

define('UPAL_TMP', getenv('UPAL_TMP') ? getenv('UPAL_TMP') : (isset($GLOBALS['UPAL_TMP']) ? $GLOBALS['UPAL_TMP'] : sys_get_temp_dir()));
// define('UNISH_SANDBOX', UNISH_TMP . '/drush-sandbox');

// Cache dir lives outside the sandbox so that we get persistence across classes.
$cache = UPAL_TMP . '/upal-cache';
putenv("CACHE_PREFIX=" . $cache);
Expand Down

0 comments on commit c4866e4

Please sign in to comment.