public function testGetByRoles() { $user = new Mage_User_Model_User(); $user->loadByUsername(Magento_Test_Bootstrap::ADMIN_NAME); $this->_collection->getByRoles($user->getRole()->getId()); $where = $this->_collection->getSelect()->getPart(Zend_Db_Select::WHERE); $this->assertContains("(role_id = '" . $user->getRole()->getId() . "')", $where); }
/** * @magentoDbIsolation enabled */ public function testDeleteFromRole() { $this->_model->loadByUsername(Magento_Test_Bootstrap::ADMIN_NAME); $this->_model->setRoleId(1)->deleteFromRole(); $role = $this->_model->getRole(); $this->assertNull($role->getId()); }