/** * @magentoAppIsolation enabled */ public function testCRUD() { Mage::app()->setCurrentStore(Mage::app()->getStore(Mage_Core_Model_App::ADMIN_STORE_ID)); $this->_model->setTypeId('simple')->setAttributeSetId(4)->setName('Simple Product')->setSku(uniqid())->setPrice(10)->setMetaTitle('meta title')->setMetaKeyword('meta keyword')->setMetaDescription('meta description')->setVisibility(Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH)->setStatus(Mage_Catalog_Model_Product_Status::STATUS_ENABLED); $crud = new Magento_Test_Entity($this->_model, array('sku' => uniqid())); $crud->testCrud(); }
/** * Test Web API User CRUD */ public function testCRUD() { $role = $this->_roleFactory->create()->load('test_role', 'role_name'); $this->_model->setApiKey('Test User Name')->setContactEmail('*****@*****.**')->setSecret('*****@*****.**')->setRoleId($role->getId()); $crud = new Magento_Test_Entity($this->_model, array('api_key' => '_User_Name_')); $crud->testCrud(); }
/** * @magentoAppIsolation enabled */ public function testCRUD() { Mage::app()->setCurrentStore(Mage::app()->getStore(Mage_Core_Model_App::ADMIN_STORE_ID)); $this->_model->setName('test'); $crud = new Magento_Test_Entity($this->_model, array('name' => uniqid())); $crud->testCrud(); }
public function testCRUD() { $this->_model = new Mage_Core_Model_Layout_Data(); $this->_model->setData(array('handle' => 'default', 'xml' => '<layout/>', 'sort_order' => 123)); $entityHelper = new Magento_Test_Entity($this->_model, array('handle' => 'custom', 'xml' => '<layout version="0.1.0"/>', 'sort_order' => 456)); $entityHelper->testCrud(); }
/** * Test crud operations for theme model using valid data */ public function testCrud() { /** @var $themeModel Mage_Core_Model_Theme */ $themeModel = Mage::getObjectManager()->create('Mage_Core_Model_Theme'); $themeModel->setData($this->_getThemeValidData()); $crud = new Magento_Test_Entity($themeModel, array('theme_version' => '2.0.0.1')); $crud->testCrud(); }
/** * Test Web API Rule CRUD */ public function testCRUD() { $role = $this->_roleFactory->create()->load('test_role', 'role_name'); $allowResourceId = 'customer/multiGet'; $this->_model->setRoleId($role->getId())->setResourceId($allowResourceId); $crud = new Magento_Test_Entity($this->_model, array('resource_id' => 'customer/get')); $crud->testCrud(); }
/** * Test crud operations for theme files model using valid data */ public function testCrud() { /** @var $themeModel Mage_Core_Model_Theme_Files */ $filesModel = Mage::getObjectManager()->create('Mage_Core_Model_Theme_Files'); $filesData = $this->_getThemeFilesValidData(); /** @var $themeModel Mage_Core_Model_Theme */ $themeModel = Mage::getObjectManager()->create('Mage_Core_Model_Theme'); $theme = $themeModel->getCollection()->getFirstItem(); $filesData['theme_id'] = $theme->getId(); $filesModel->setData($filesData); $crud = new Magento_Test_Entity($filesModel, array('file_name' => 'rename.css')); $crud->testCrud(); }
public function testCRUD() { $this->_model->setStoreId(Mage::app()->getDefaultStoreView()->getId())->setRequestPath('fancy/url.html')->setTargetPath('catalog/product/view')->setIsSystem(1)->setOptions('RP'); $crud = new Magento_Test_Entity($this->_model, array('request_path' => 'fancy/url2.html')); $crud->testCrud(); }
public function testCRUD() { $this->_model->setCustomerGroupCode('test'); $crud = new Magento_Test_Entity($this->_model, array('customer_group_code' => uniqid())); $crud->testCrud(); }
public function testCRUD() { $this->_model->setAttributeCode('test')->setEntityTypeId(Mage::getSingleton('Mage_Eav_Model_Config')->getEntityType('catalog_product')->getId())->setFrontendLabel('test'); $crud = new Magento_Test_Entity($this->_model, array('frontend_label' => uniqid())); $crud->testCrud(); }
/** * @magentoAppIsolation enabled */ public function testCRUD() { $this->_model->setData(array('code' => 'test_website', 'name' => 'test website', 'default_group_id' => 1)); /* emulate admin store */ Mage::app()->getStore()->setId(Mage_Core_Model_App::ADMIN_STORE_ID); $crud = new Magento_Test_Entity($this->_model, array('name' => 'new name')); $crud->testCrud(); }
public function testCRUD() { $this->_model->setData(array('scope' => 'default', 'scope_id' => 0, 'path' => 'test/config/path', 'value' => 'test value')); $crud = new Magento_Test_Entity($this->_model, array('value' => 'new value')); $crud->testCrud(); }
/** * @magentoDbIsolation enabled */ public function testCRUD() { $this->_model->setFirstname("John")->setLastname("Doe")->setUsername('user2')->setPassword(Magento_Test_Bootstrap::ADMIN_PASSWORD)->setEmail('*****@*****.**'); $crud = new Magento_Test_Entity($this->_model, array('firstname' => '_New_name_')); $crud->testCrud(); }
/** * Test Web API Role CRUD */ public function testCRUD() { $this->_model->setRoleName('Test Role Name'); $crud = new Magento_Test_Entity($this->_model, array('role_name' => '_Role_Name_')); $crud->testCrud(); }
/** * @magentoDbIsolation enabled */ public function testCRUD() { $this->_model->setRoleType('G')->setResourceId(Mage_Backend_Model_Acl_Config::ACL_RESOURCE_ALL)->setPrivileges("")->setAssertId(0)->setRoleId(1)->setPermission('allow'); $crud = new Magento_Test_Entity($this->_model, array('permission' => 'deny')); $crud->testCrud(); }