Example #1
0
 /**
  * @return void
  */
 public function testCountChildren()
 {
     $this->object->toHtml();
     $fieldset = $this->object->getForm()->getElement('return_fieldset');
     $this->assertEquals(5, $fieldset->getElements()->count(), 'Wrong form elements for US channel');
     //for UK channel
     $channel = Mage::registry('current_channel');
     $channel->setSiteCode('UK');
     $this->object->toHtml();
     $fieldset = $this->object->getForm()->getElement('return_fieldset');
     $this->assertEquals(1, $fieldset->getElements()->count(), 'Wrong form elements for UK channel');
 }
Example #2
0
 public function testGetChannelType()
 {
     Mage::clearRegistry();
     Mage::register('current_channel', new Varien_Object(array('channeltype_code' => 'test_channeltype_code')));
     $result = $this->object->getChannelType();
     $this->assertInstanceOf('Varien_Object', $result);
     $this->assertFalse($result->hasData());
     $channel = Mage::getModel('xcom_ebay/channel');
     $channel->setId(1);
     $channel->setName('Ebay US');
     $channel->setChanneltypeCode('ebay');
     Mage::clearRegistry();
     Mage::register('current_channel', $channel);
     $result = $this->object->getChannelType();
     $this->assertInstanceOf('Varien_Object', $result);
     $this->assertTrue($result->hasData());
     $this->assertEquals('ebay', $result->getCode());
 }