Definition at line 8 of file WebsiteTest.php.
◆ setUp()
Definition at line 15 of file WebsiteTest.php.
18 \
Magento\Store\Model\Website::class
20 $this->_model->load(1);
static getObjectManager()
◆ testCollection()
◆ testCRUD()
@magentoAppIsolation enabled @magentoAppArea adminhtml
Definition at line 175 of file WebsiteTest.php.
177 $this->_model->setData([
'code' =>
'test_website',
'name' =>
'test website',
'default_group_id' => 1]);
180 $crud = new \Magento\TestFramework\Entity($this->_model, [
'name' =>
'new name']);
◆ testGetBaseCurrency()
Definition at line 145 of file WebsiteTest.php.
147 $currency = $this->_model->getBaseCurrency();
148 $this->assertInstanceOf(\
Magento\Directory\Model\Currency::class, $currency);
149 $this->assertEquals(
'USD', $currency->getCode());
◆ testGetDefaultGroup()
Definition at line 92 of file WebsiteTest.php.
94 $defaultGroup = $this->_model->getDefaultGroup();
95 $this->assertInstanceOf(\
Magento\Store\Model\Group::class, $defaultGroup);
96 $this->assertEquals(1, $defaultGroup->getId());
98 $this->_model->setDefaultGroupId(
null);
99 $this->assertFalse($this->_model->getDefaultGroup());
◆ testGetDefaultGroupId()
testGetDefaultGroupId |
( |
| ) |
|
Definition at line 140 of file WebsiteTest.php.
142 $this->assertEquals(1, $this->_model->getDefaultGroupId());
◆ testGetDefaultStore()
Definition at line 152 of file WebsiteTest.php.
154 $defaultStore = $this->_model->getDefaultStore();
155 $this->assertInstanceOf(\
Magento\Store\Model\Store::class, $defaultStore);
156 $this->assertEquals(1, $defaultStore->getId());
◆ testGetDefaultStoresSelect()
testGetDefaultStoresSelect |
( |
| ) |
|
Definition at line 159 of file WebsiteTest.php.
161 $this->assertInstanceOf(\
Magento\Framework\DB\Select::class, $this->_model->getDefaultStoresSelect());
◆ testGetGroupIds()
Definition at line 82 of file WebsiteTest.php.
84 $this->assertEquals([1 => 1], $this->_model->getGroupIds());
◆ testGetGroups()
Definition at line 74 of file WebsiteTest.php.
76 $groups = $this->_model->getGroups();
77 $this->assertEquals([1], array_keys($groups));
78 $this->assertInstanceOf(\
Magento\Store\Model\Group::class, $groups[1]);
79 $this->assertEquals(1, $groups[1]->getId());
◆ testGetGroupsCount()
Definition at line 87 of file WebsiteTest.php.
89 $this->assertEquals(1, $this->_model->getGroupsCount());
◆ testGetStoreCodes()
Definition at line 115 of file WebsiteTest.php.
117 $this->assertEquals([1 =>
'default'], $this->_model->getStoreCodes());
◆ testGetStoreIds()
Definition at line 110 of file WebsiteTest.php.
112 $this->assertEquals([1 => 1], $this->_model->getStoreIds());
◆ testGetStores()
Definition at line 102 of file WebsiteTest.php.
104 $stores = $this->_model->getStores();
105 $this->assertEquals([1], array_keys(
$stores));
106 $this->assertInstanceOf(\
Magento\Store\Model\Store::class,
$stores[1]);
107 $this->assertEquals(1,
$stores[1]->getId());
◆ testGetStoresCount()
Definition at line 120 of file WebsiteTest.php.
122 $this->assertEquals(1, $this->_model->getStoresCount());
◆ testGetWebsiteGroupStore()
testGetWebsiteGroupStore |
( |
| ) |
|
Definition at line 132 of file WebsiteTest.php.
134 $this->assertEquals(
'1--', $this->_model->getWebsiteGroupStore());
135 $this->_model->setGroupId(123);
136 $this->_model->setStoreId(456);
137 $this->assertEquals(
'1-123-456', $this->_model->getWebsiteGroupStore());
◆ testIsCanDelete()
Definition at line 125 of file WebsiteTest.php.
127 $this->assertFalse($this->_model->isCanDelete());
128 $this->_model->isReadOnly(
true);
129 $this->assertFalse($this->_model->isCanDelete());
◆ testIsReadonly()
Definition at line 164 of file WebsiteTest.php.
166 $this->assertFalse($this->_model->isReadOnly());
167 $this->_model->isReadOnly(
true);
168 $this->assertTrue($this->_model->isReadOnly());
◆ testLoadByCode()
@magentoDbIsolation enabled
Definition at line 36 of file WebsiteTest.php.
38 $this->_model->load(
'admin');
39 $this->assertEquals(0, $this->_model->getId());
40 $this->assertEquals(
'admin', $this->_model->getCode());
41 $this->assertEquals(
'Admin', $this->_model->getName());
◆ testLoadById()
@magentoDbIsolation enabled
Definition at line 26 of file WebsiteTest.php.
28 $this->assertEquals(1, $this->_model->getId());
29 $this->assertEquals(
'base', $this->_model->getCode());
30 $this->assertEquals(
'Main Website', $this->_model->getName());
◆ testSetGroupsAndStores()
testSetGroupsAndStores |
( |
| ) |
|
@covers \Magento\Store\Model\Website::setGroups @covers \Magento\Store\Model\Website::setStores @covers \Magento\Store\Model\Website::getStores
Definition at line 49 of file WebsiteTest.php.
53 \
Magento\Store\Model\Group::class
55 $expectedGroup->setId(123);
56 $this->_model->setDefaultGroupId($expectedGroup->getId());
57 $this->_model->setGroups([$expectedGroup]);
59 $groups = $this->_model->getGroups();
60 $this->assertSame($expectedGroup, reset($groups));
64 \
Magento\Store\Model\Store::class
66 $expectedStore->setId(456);
67 $expectedGroup->setDefaultStoreId($expectedStore->getId());
68 $this->_model->setStores([$expectedStore]);
70 $stores = $this->_model->getStores();
71 $this->assertSame($expectedStore, reset(
$stores));
static getObjectManager()
◆ $_model
The documentation for this class was generated from the following file:
- vendor/magento/magento2-base/dev/tests/integration/testsuite/Magento/Store/Model/WebsiteTest.php