Пример #1
0
 /**
  * @param PHPUnit_Framework_MockObject_MockObject|Zend_Db_Adapter_Abstract $adapter
  * @depends testSetAddOrder
  */
 public function testUnshiftOrder($adapter)
 {
     $this->_collection->setConnection($adapter);
     $this->_collection->addOrder('some_field', Varien_Data_Collection::SORT_ORDER_ASC);
     $this->_collection->unshiftOrder('other_field', Varien_Data_Collection::SORT_ORDER_ASC);
     $this->_collection->load();
     $selectOrders = $this->_collection->getSelect()->getPart(Zend_Db_Select::ORDER);
     $this->assertEquals('other_field ASC', (string) array_shift($selectOrders));
     $this->assertEquals('some_field ASC', (string) array_shift($selectOrders));
     $this->assertEmpty(array_shift($selectOrders));
 }