/** * @covers Mage_Backend_Block_Store_Switcher::getWebsiteCollection */ public function testGetWebsiteCollectionWhenWebSiteIdsIsSet() { $websiteModel = $this->getMock('Mage_Core_Model_Website', array(), array(), '', false, false); $collection = $this->getMock('Mage_Core_Model_Resource_Website_Collection', array(), array(), '', false, false); $websiteModel->expects($this->once())->method('getResourceCollection')->will($this->returnValue($collection)); $ids = array(1, 2, 3); $this->_object->setWebsiteIds($ids); $expected = array('test', 'data', 'some'); $collection->expects($this->once())->method('load')->will($this->returnValue($expected)); $collection->expects($this->once())->method('addIdFilter')->with($ids); $this->_websiteFactory->expects($this->once())->method('create')->will($this->returnValue($websiteModel)); $actual = $this->_object->getWebsiteCollection(); $this->assertEquals($expected, $actual); }