commerce_ups.test in Commerce UPS 7
File
tests/commerce_ups.test
View source
<?php
class CommerceUPSAdministrationTestCase extends CommerceBaseTestCase {
protected $order;
public static function getInfo() {
return array(
'name' => 'Commerce UPS',
'description' => 'Commerce UPS admin stuff...',
'group' => 'Drupal Commerce',
);
}
function setUp() {
$modules = parent::setUpHelper('all');
$final_modules = array_unique(array_merge($modules, array(
'commerce_ups',
)));
parent::setUp($final_modules);
$permissions = parent::permissionBuilder('all');
$final_permissions = array_unique(array_merge($permissions, array(
'administer shipping',
)));
$user = $this
->drupalCreateUser($final_permissions);
$this
->drupalLogin($user);
}
public function testCommerceUPSSettingsForm() {
$this
->drupalGet('admin/commerce/config/shipping/methods/ups/edit');
$this
->assertResponse(200, 'Hit something');
}
public function testCommerceUPSFieldSaves() {
$form = array(
'commerce_ups_account_id' => 'test',
'commerce_ups_user_id' => 'test1',
'commerce_ups_access_key' => 'test2',
'commerce_ups_access_key' => 'test3',
'commerce_ups_default_package_size_length' => 1,
'commerce_ups_default_package_size_width' => 2,
'commerce_ups_default_package_size_height' => 3,
'commerce_ups_password' => 'testb',
);
$this
->drupalPost('admin/commerce/config/shipping/methods/ups/edit', $form, t('Save configuration'));
}
}