本文整理汇总了PHP中Mage_Core_Model_Store::load方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Model_Store::load方法的具体用法?PHP Mage_Core_Model_Store::load怎么用?PHP Mage_Core_Model_Store::load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Core_Model_Store
的用法示例。
在下文中一共展示了Mage_Core_Model_Store::load方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testSaveAction
/**
* @magentoDataFixture Mage/Core/_files/store.php
* @magentoDbIsolation enabled
* @dataProvider saveActionDataProvider
* @param array $inputData
* @param array $defaultAttributes
* @param array $attributesSaved
*/
public function testSaveAction($inputData, $defaultAttributes, $attributesSaved = array())
{
$store = new Mage_Core_Model_Store();
$store->load('fixturestore', 'code');
$storeId = $store->getId();
$this->getRequest()->setPost($inputData);
$this->getRequest()->setParam('store', $storeId);
$this->getRequest()->setParam('id', 2);
$this->dispatch('backend/admin/catalog_category/save');
$messages = Mage::getSingleton('Mage_Backend_Model_Session')->getMessages(false)->getItemsByType(Mage_Core_Model_Message::SUCCESS);
$this->assertNotEmpty($messages, "Could not save category");
$this->assertEquals('The category has been saved.', current($messages)->getCode());
$category = new Mage_Catalog_Model_Category();
$category->setStoreId($storeId);
$category->load(2);
$errors = array();
foreach ($attributesSaved as $attribute => $value) {
$actualValue = $category->getData($attribute);
if ($value !== $actualValue) {
$errors[] = "value for '{$attribute}' attribute must be '{$value}', but '{$actualValue}' is found instead";
}
}
foreach ($defaultAttributes as $attribute => $exists) {
if ($exists !== $category->getExistsStoreValueFlag($attribute)) {
if ($exists) {
$errors[] = "custom value for '{$attribute}' attribute is not found";
} else {
$errors[] = "custom value for '{$attribute}' attribute is found, but default one must be used";
}
}
}
$this->assertEmpty($errors, "\n" . join("\n", $errors));
}
示例2: testIsCanDelete
public function testIsCanDelete()
{
$this->assertFalse($this->_model->isCanDelete());
$this->_model->load(1);
$this->assertFalse($this->_model->isCanDelete());
$this->_model->setId(100);
$this->assertTrue($this->_model->isCanDelete());
}