/**
  * {@inheritdoc}
  */
 protected function tearDown()
 {
     // Cleanup keys directory after test.
     \Drupal::service('file_system')->unlink('sites/default/files/simpletest.keys/' . UC_CREDIT_KEYFILE_NAME);
     \Drupal::service('file_system')->rmdir('sites/default/files/simpletest.keys');
     parent::tearDown();
 }
 public function setUp()
 {
     parent::setUp();
     // Need page_title_block because we test page titles
     $this->drupalPlaceBlock('page_title_block');
     $this->drupalLogin($this->adminUser);
 }
Exemple #3
0
 public function setUp()
 {
     parent::setUp();
     // Need page_title_block because we test page titles
     $this->drupalPlaceBlock('page_title_block');
     // Create a simple customer user account.
     $this->customer = $this->drupalCreateUser(array('view own orders'));
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     // Create a simple customer user account.
     $this->customer = $this->drupalCreateUser();
     // Ensure test mails are logged.
     \Drupal::configFactory()->getEditable('system.mail')->set('interface.uc_order', 'test_mail_collector')->save();
 }
Exemple #5
0
 public function setUp()
 {
     parent::setUp();
     // Need page_title_block because we test page titles
     $this->drupalPlaceBlock('page_title_block');
     // Ensure test mails are logged.
     \Drupal::configFactory()->getEditable('system.mail')->set('interface.uc_stock', 'test_mail_collector')->save();
     $this->drupalLogin($this->adminUser);
 }
 public function setUp()
 {
     parent::setUp();
     // Create a random address object for use in tests.
     $this->test_address[] = $this->createAddress();
     // Create a specific address object for use in tests.
     $settings = array('first_name' => 'Elmo', 'last_name' => 'Monster', 'company' => 'CTW, Inc.', 'street1' => '123 Sesame Street', 'street2' => '', 'city' => 'New York', 'zone' => 'NY', 'country' => 'US', 'postal_code' => '10010', 'phone' => '1234567890', 'email' => '*****@*****.**');
     $this->test_address[] = $this->createAddress($settings);
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     // Log in and add a product to the cart for testing.
     $this->drupalLogin($this->adminUser);
     $this->addToCart($this->product);
     // Disable address panes during checkout.
     $edit = array('panes[delivery][status]' => FALSE, 'panes[billing][status]' => FALSE);
     $this->drupalPostForm('admin/store/config/checkout', $edit, t('Save configuration'));
 }
Exemple #8
0
 public function setUp()
 {
     parent::setUp();
     $this->drupalLogin($this->adminUser);
     // In order to test zone-based conditions, this particular test class
     // assumes that US is enabled as default, and CA is also enabled.
     \Drupal\uc_country\Entity\Country::load('US')->enable()->save();
     \Drupal\uc_country\Entity\Country::load('CA')->enable()->save();
     \Drupal::configFactory()->getEditable('uc_store.settings')->set('address.country', 'US')->save();
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->drupalLogin($this->adminUser);
     // module_load_include() has to be called after parent::setUp()
     // because the moduler_handler service isn't initialized yet.
     module_load_include('inc', 'uc_store', 'includes/uc_ajax_attach');
     // In order to test zone-based conditions, this particular test class
     // assumes that US is enabled and set as the store country.
     Country::load('US')->enable()->save();
     \Drupal::configFactory()->getEditable('uc_store.settings')->set('address.country', 'US')->save();
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     // Create a simple customer user account.
     $this->cartManager = \Drupal::service('uc_cart.manager');
     $this->cart = $this->cartManager->get();
     // Create a simple customer user account.
     $this->customer = $this->drupalCreateUser();
     // Create a payment method.
     $this->createPaymentMethod('check');
     // Ensure test mails are logged.
     \Drupal::configFactory()->getEditable('system.mail')->set('interface.uc_order', 'test_mail_collector')->save();
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     // Set front page so we have someplace to redirect to for invalid Cart Links.
     \Drupal::configFactory()->getEditable('system.site')->set('page.front', '/node')->save();
     // Need page_title_block because we test page titles
     $this->drupalPlaceBlock('page_title_block');
     // System help block is needed to see output from hook_help().
     $this->drupalPlaceBlock('help_block', array('region' => 'help'));
     // Testing profile doesn't include a 'page' content type.
     // We will need this to create pages with links on them.
     $this->drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page'));
     // Create Full HTML text format, needed because we want links
     // to appear on pages.
     $full_html_format = FilterFormat::create(array('format' => 'full_html', 'name' => 'Full HTML'));
     $full_html_format->save();
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     // Need page_title_block because we test page titles
     $this->drupalPlaceBlock('page_title_block');
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->drupalLogin($this->adminUser);
     $this->addToCart($this->product);
 }
 /**
  * {@inheritdoc}
  */
 protected function tearDown()
 {
     // Cleanup - delete our test file.
     \Drupal::service('file_system')->unlink($this->getTempFilesDirectory() . '/' . $this->testFilename);
     parent::tearDown();
 }
Exemple #15
0
 public function setUp()
 {
     parent::setUp();
     $this->drupalLogin($this->adminUser);
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->drupalLogin($this->adminUser);
 }
 public function setUp()
 {
     parent::setUp();
     $this->block = $this->drupalPlaceBlock('uc_cart');
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->drupalPlaceBlock('system_breadcrumb_block');
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->adminUser = $this->drupalCreateUser(array('access user profiles', 'view customers'));
     $this->customer = $this->drupalCreateUser();
 }