Skip to content

Commit 34cab3f

Browse files
committed
Add test to demonstrate issue with no logo
1 parent b2c1627 commit 34cab3f

File tree

2 files changed

+76
-0
lines changed

2 files changed

+76
-0
lines changed

tests/BigCommerceLegacyApi/Api/StoreInformation/StoreInformationApiTest.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,20 @@ public function testCanGetStoreInformation(): void
2121

2222
$this->assertEquals('BigCommerce', $information->name);
2323
$this->assertEquals('my-awesome.store', $information->domain);
24+
$this->assertEquals(
25+
'https://cdn8.bigcommerce.com/s-{store_hash}/product_images/screen_shot_2018-05-15_at_12.22.26_pm__05547_1529512135.png',
26+
$information->logo->url
27+
);
28+
}
29+
30+
public function testCanGetStoreInformationForStoreWithNoLogo()
31+
{
32+
//Weird API design means the logo is set to empty array if no logo present
33+
$this->setReturnData('storeinformation_store__no-logo.json');
34+
35+
$information = $this->getApi()->storeInformation()->storeInformation();
36+
37+
$this->assertEquals('BigCommerce', $information->name);
38+
$this->assertNull($information->logo);
2439
}
2540
}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{
2+
"id": "amkfvuhbq3",
3+
"account_uuid": "b73387ce-abxc-4e78-8b82-9b1d06f19ea2",
4+
"domain": "mlitest.mybigcommerce.com",
5+
"secure_url": "https://mli.mybigcommerce.com",
6+
"control_panel_base_url": "https://store-ioufvuhbq5.mybigcommerce.com",
7+
"status": "prelaunch",
8+
"name": "MLITest",
9+
"first_name": "Jarrod",
10+
"last_name": "Swift",
11+
"address": "",
12+
"country": "Australia",
13+
"country_code": "AU",
14+
"phone": "",
15+
"admin_email": "[email protected]",
16+
"order_email": "[email protected]",
17+
"favicon_url": "https://cdn11.bigcommerce.com/r-8e9780100977368b96291d000214555c233b72c/img/bc_favicon.ico",
18+
"timezone": {
19+
"name": "Europe/London",
20+
"raw_offset": 0,
21+
"dst_offset": 0,
22+
"dst_correction": false,
23+
"date_format": {
24+
"display": "jS M Y",
25+
"export": "jS M Y",
26+
"extended_display": "jS M Y @ g:i A"
27+
}
28+
},
29+
"language": "en",
30+
"currency": "AUD",
31+
"currency_symbol": "$",
32+
"decimal_separator": ".",
33+
"thousands_separator": ",",
34+
"decimal_places": 2,
35+
"currency_symbol_location": "left",
36+
"weight_units": "KGS",
37+
"dimension_units": "Centimeters",
38+
"dimension_decimal_places": 2,
39+
"dimension_decimal_token": ".",
40+
"dimension_thousands_token": ",",
41+
"plan_name": "Partner Sandbox",
42+
"plan_level": "Sandbox Store",
43+
"plan_is_trial": false,
44+
"industry": "Animals & Pet Supplies",
45+
"logo": [],
46+
"is_price_entered_with_tax": true,
47+
"store_id": 1002483486,
48+
"default_site_id": 1000,
49+
"default_channel_id": 1,
50+
"active_comparison_modules": [],
51+
"features": {
52+
"stencil_enabled": true,
53+
"sitewidehttps_enabled": true,
54+
"facebook_catalog_id": "",
55+
"checkout_type": "optimized",
56+
"wishlists_enabled": true,
57+
"graphql_storefront_api_enabled": true,
58+
"shopper_consent_tracking_enabled": false,
59+
"multi_storefront_enabled": true
60+
}
61+
}

0 commit comments

Comments
 (0)