Exemplo n.º 1
0
 public function testSaveAction()
 {
     $helper = new AW_Autorelated_Test_Helper();
     if ($helper->prepareAdminUser()) {
         $this->getRequest()->setMethod('GET');
         $this->dispatch('awautorelated_admin/adminhtml_categoryblock/save');
         $this->assertRedirectTo('awautorelated_admin/adminhtml_blocksgrid/list');
         $helper->preparePost($this->getRequest());
         $this->dispatch('awautorelated_admin/adminhtml_categoryblock/save');
         $this->assertRedirectTo('awautorelated_admin/adminhtml_categoryblock/edit', array('fswe' => 1));
     }
 }
Exemplo n.º 2
0
 public function testSelecttypePostAction()
 {
     $helper = new AW_Autorelated_Test_Helper();
     if ($helper->prepareAdminUser()) {
         $helper->preparePost($this->getRequest());
         $this->dispatch('awautorelated_admin/adminhtml_blocksgrid/selecttype');
         $this->assertRedirectTo('awautorelated_admin/adminhtml_blocksgrid/selecttype');
         $helper->preparePost($this->getRequest());
         $this->getRequest()->setParam('block_type', AW_Autorelated_Model_Source_Type::PRODUCT_PAGE_BLOCK);
         $this->dispatch('awautorelated_admin/adminhtml_blocksgrid/selecttype');
         $this->assertRedirectTo('awautorelated_admin/adminhtml_productblock/new');
         $helper->preparePost($this->getRequest());
         $this->getRequest()->setParam('block_type', AW_Autorelated_Model_Source_Type::CATEGORY_PAGE_BLOCK);
         $this->dispatch('awautorelated_admin/adminhtml_blocksgrid/selecttype');
         $this->assertRedirectTo('awautorelated_admin/adminhtml_categoryblock/new');
     }
 }