Permalink
Browse files

Fixed missing DB_PORT when creating new DB object. #3128

  • Loading branch information...
1 parent 0db2555 commit c990cec427f367dd54eed0c2a149e679c01c064d @jamesallsup jamesallsup committed Jun 24, 2015
Oops, something went wrong.
@@ -1,20 +1,20 @@
<?php
class CatalogPayPalExpressTest extends OpenCartSeleniumTest {
-
+
private $moduleInstalled = false;
-
+
/**
* @before
*/
protected function before() {
$this->setBrowser('firefox');
$this->setBrowserUrl(HTTP_SERVER);
}
-
+
public function setUpPage() {
if (!$this->moduleInstalled) {
- $db = new DB(DB_DRIVER, DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_DATABASE);
+ $db = new DB(DB_DRIVER, DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_DATABASE, DB_PORT);
$db->query("DROP TABLE IF EXISTS " . DB_PREFIX . "paypal_order");
$db->query("DROP TABLE IF EXISTS " . DB_PREFIX . "paypal_order_transaction");
$db->query("DELETE l, lr FROM " . DB_PREFIX . "layout l, " . DB_PREFIX . "layout_route lr WHERE l.layout_id = lr.layout_id AND l.`name` = 'Cart'");
@@ -28,146 +28,146 @@ public function setUpPage() {
$this->keys(ADMIN_PASSWORD);
$this->byCssSelector('button[type="submit"]')->click();
-
+
$this->moduleInstalled = true;
$this->waitToLoad('Dashboard');
-
+
// Installing the payment module
$this->clickOnElement('button-menu');
-
+
$this->waitToAppearAndClick('#extension a');
$this->waitToAppearAndClick('#extension li:nth-child(5) a');
-
+
$this->waitToLoad('Payment');
-
+
$i = 1;
-
+
for ( ; ; $i++) {
$element = $this->byCssSelector(".table-bordered tbody tr:nth-child($i) td:first-child");
-
+
if ($element->text() == 'PayPal Express Checkout') {
break;
}
}
-
+
$this->waitToAppearAndClick(".table-bordered tbody tr:nth-child($i) td:last-child a.btn-success");
$this->waitToAppearAndClick(".table-bordered tbody tr:nth-child($i) td:last-child a.btn-primary");
-
+
$this->waitToLoad('PayPal Express Checkout');
-
+
$this->clickOnElement('entry-username');
$this->keys(PP_EXPRESS_API_USERNAME);
-
+
$this->clickOnElement('entry-password');
$this->keys(PP_EXPRESS_API_PASSWORD);
-
+
$this->clickOnElement('entry-signature');
$this->keys(PP_EXPRESS_API_SIGNATURE);
-
+
$this->byCssSelector('a[href="#tab-general"]')->click();
-
+
$this->waitToAppearAndClick('#input-live-demo option[value="1"]');
-
+
for ($i = 1; ; $i++) {
$element = $this->byCssSelector('#input-currency option:nth-child(' . $i . ')');
-
+
if ($element->text() == 'USD') {
$element->click();
break;
}
}
-
+
$this->clickOnElement('input-total');
$this->keys('0.00');
-
+
$this->byCssSelector('#input-status option[value="1"]')->click();
-
+
$this->byCssSelector('.pull-right button.btn')->click();
-
+
// Adding the Cart Layout
$this->waitToAppearAndClick('#system a');
$this->waitToAppearAndClick('#system li:nth-child(2) a');
$this->waitToAppearAndClick('#system li:nth-child(2) li:first-child a');
-
+
$this->waitToLoad('Layouts');
$this->byCssSelector('.fa-plus-circle')->click();
-
+
$this->waitToAppearAndClick('#input-name');
$this->keys('Cart');
-
+
$this->byCssSelector('.fa-plus-circle')->click();
-
+
$this->byCssSelector('input[name="layout_route[0][route]"]')->click();
$this->keys('checkout/cart');
-
+
$this->byCssSelector('.fa-check-circle')->click();
-
+
// Installing the payment button
$this->waitToAppearAndClick('#extension a');
$this->waitToAppearAndClick('#extension li:nth-child(3) a');
-
+
$i = 1;
-
+
for ( ; ; $i++) {
$element = $this->byCssSelector(".table-bordered tbody tr:nth-child($i) td:first-child");
-
+
if ($element->text() == 'PayPal Express Checkout button') {
break;
}
}
-
+
$this->waitToAppearAndClick(".table-bordered tbody tr:nth-child($i) td:last-child a.btn-success");
$this->waitToAppearAndClick(".table-bordered tbody tr:nth-child($i) td:last-child a.btn-primary");
-
- $this->waitToLoad('PayPal Express Checkout button');
+
+ $this->waitToLoad('PayPal Express Checkout button');
$this->byCssSelector('.fa-plus-circle')->click();
-
+
for ($i = 1; ; $i++) {
$element = $this->byCssSelector("select[name=\"pp_button_module[0][layout_id]\"] option:nth-child($i)");
-
+
if ($element->text() == 'Cart') {
$element->click();
break;
}
}
-
+
$this->byCssSelector('button[title="Save"]')->click();
}
}
-
+
public function testOneProduct() {
$this->url('index.php?route=product/product&product_id=43');
$this->clickOnElement('button-cart');
-
+
$this->url('index.php?route=checkout/cart');
$this->waitToLoad('Shopping Cart');
-
+
$this->byCssSelector('.pp-express-button')->click();
-
+
$this->waitToLoad("Pay with a PayPal", 30000);
-
+
$this->clickOnElement('login_email');
$this->keys(PP_EXPRESS_USERNAME);
-
+
$this->clickOnElement('login_password');
$this->keys(PP_EXPRESS_PASSWORD);
-
+
$this->clickOnElement('submitLogin');
-
+
$this->waitToLoad("Review your information", 30000);
-
+
$this->clickOnElement('continue_abovefold');
-
+
$this->waitToLoad("Confirm order", 30000);
-
+
$this->byCssSelector('.pull-right .btn-primary')->click();
-
+
$this->waitToLoad("Your order has been placed!");
-
+
$element = $this->byCssSelector('#content h1');
-
+
$this->assertEquals('Your order has been placed!', $element->text());
}
-
+
}
@@ -14,7 +14,7 @@ protected function before() {
public function setUpPage() {
if (!$this->moduleInstalled) {
- $db = new DB(DB_DRIVER, DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_DATABASE);
+ $db = new DB(DB_DRIVER, DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_DATABASE, DB_PORT);
$db->query("DROP TABLE IF EXISTS " . DB_PREFIX . "sagepay_direct_order");
$db->query("DROP TABLE IF EXISTS " . DB_PREFIX . "sagepay_direct_order_transaction");
$db->query("DROP TABLE IF EXISTS " . DB_PREFIX . "sagepay_direct_order_recurring");
@@ -17,7 +17,7 @@
require(DIR_SYSTEM . 'library/db.php');
require(DIR_SYSTEM . 'library/db/' . DB_DRIVER . '.php');
-$db = new DB(DB_DRIVER, DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_DATABASE);
+$db = new DB(DB_DRIVER, DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_DATABASE, DB_PORT);
/**
* Store settings configuration
@@ -24,7 +24,7 @@
$registry->set('config', $config);
// Database
-$db = new DB(DB_DRIVER, DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_DATABASE);
+$db = new DB(DB_DRIVER, DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_DATABASE, DB_PORT);
$registry->set('db', $db);
// Settings
View
@@ -28,7 +28,7 @@
$registry->set('config', $config);
// Database
-$db = new DB(DB_DRIVER, DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_DATABASE);
+$db = new DB(DB_DRIVER, DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_DATABASE, DB_PORT);
$registry->set('db', $db);
// Store
@@ -3,7 +3,7 @@ class ControllerMaxmind extends Controller {
private $error = array();
public function index() {
- $db = new DB(DB_DRIVER, DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_DATABASE);
+ $db = new DB(DB_DRIVER, DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_DATABASE, DB_PORT);
if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
$db->query("REPLACE INTO `" . DB_PREFIX . "setting` SET `config_fraud_status_id` = '1', `config_fraud_score` = '" . (int)$this->request->post['config_fraud_score'] . "', `config_fraud_key` = '" . $db->escape($this->request->post['config_fraud_score']) . "', `config_fraud_detection` = '" . (int)$this->request->post['config_fraud_detection'] . "' WHERE `store_id` = '0' AND `code` = 'config'");
@@ -1,7 +1,7 @@
<?php
class ModelInstall extends Model {
public function database($data) {
- $db = new DB($data['db_driver'], $data['db_hostname'], $data['db_username'], $data['db_password'], $data['db_database']);
+ $db = new DB($data['db_driver'], $data['db_hostname'], $data['db_username'], $data['db_password'], $data['db_database'], $data['db_port']);
$file = DIR_APPLICATION . 'opencart.sql';
@@ -134,7 +134,7 @@ public function mysql() {
}
}
- $this->db = new DB(DB_DRIVER, DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_DATABASE);
+ $this->db = new DB(DB_DRIVER, DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_DATABASE, DB_PORT);
// Get all current tables, fields, type, size, etc..
$table_old_data = array();

0 comments on commit c990cec

Please sign in to comment.