Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issues with unit-tests. #660

Merged
merged 1 commit into from
Jun 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/php/Checkout/Component/CheckoutComponentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ public function testSinglePageConfigForSingleCountrySiteWithReadonlyFieldsForCou
{
// Set as a single country site
$siteConfig = SiteConfig::current_site_config();
$siteConfig->AllowedCountries = 'NZ';
$siteConfig->AllowedCountries = '["NZ"]';
$siteConfig->write();

$this->assertEquals(
Expand Down
6 changes: 6 additions & 0 deletions tests/php/Extension/SteppedCheckoutExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
use SilverStripe\Control\Controller;
use SilverStripe\Control\Director;
use SilverStripe\Control\HTTPRequest;
use SilverStripe\Core\Config\Config;
use SilverStripe\Dev\FunctionalTest;
use SilverStripe\Omnipay\GatewayInfo;
use SilverStripe\Security\Member;
use SilverStripe\Security\Security;

Expand Down Expand Up @@ -56,6 +58,10 @@ public function setUp()
parent::setUp();
$this->logInWithPermission('ADMIN');

Config::modify()->merge(GatewayInfo::class, 'Dummy', [
'is_offsite' => false
]);

ShopTest::setConfiguration();
ShoppingCart::singleton()->clear();
//set up steps
Expand Down
2 changes: 1 addition & 1 deletion tests/php/Fixtures/singlecountry.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SilverStripe\SiteConfig\SiteConfig:
config:
Title: Shop Testing Website
AllowedCountries: NZ
AllowedCountries: '["NZ"]'
2 changes: 1 addition & 1 deletion tests/php/Forms/CheckoutFormTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public function testCheckoutForm()
public function testCheckoutFormForSingleCountrySiteWithReadonlyFieldsForCountry()
{
$siteConfig = SiteConfig::current_site_config();
$siteConfig->AllowedCountries = 'NZ';
$siteConfig->AllowedCountries = '["NZ"]';
$siteConfig->write();

$this->assertEquals(
Expand Down
5 changes: 4 additions & 1 deletion tests/php/Forms/OrderActionsFormTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ public function setUp()
$this->logOut();

OrderManipulationExtension::add_session_order($this->order);
Config::modify()->set(Payment::class, 'allowed_gateways', array('Dummy'));
Config::modify()->set(Payment::class, 'allowed_gateways', ['Dummy']);
Config::modify()->merge(GatewayInfo::class, 'Dummy', [
'is_offsite' => false
]);
}

public function testOffsitePayment()
Expand Down
2 changes: 1 addition & 1 deletion tests/php/Page/AccountPageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public function testAddressBookWithReadonlyFieldForCountry()

// setup a single-country site
$siteconfig = DataObject::get_one(SiteConfig::class);
$siteconfig->AllowedCountries = "NZ";
$siteconfig->AllowedCountries = '["NZ"]';
$siteconfig->write();
$singlecountry = SiteConfig::current_site_config();
$this->assertEquals(
Expand Down