/** * Test related method */ public function testGetGroups() { $groups = array($otherGroup = $this->getGroupMock(1, 'Other', 5), $generalGroup = $this->getGroupMock(2, 'General', 0), $alphaGroup = $this->getGroupMock(3, 'Alpha', 20), $betaGroup = $this->getGroupMock(4, 'Beta', 10)); foreach ($groups as $group) { $this->product->addValue($this->getValueMock($this->getAttributeMock($group))); } $groups = $this->product->getOrderedGroups(); $this->assertSame(4, count($groups)); $this->assertSame($generalGroup, current($groups)); $this->assertSame($otherGroup, next($groups)); $this->assertSame($betaGroup, next($groups)); $this->assertSame($alphaGroup, next($groups)); }
/** * {@inheritDoc} */ public function getOrderedGroups() { $this->__initializer__ && $this->__initializer__->__invoke($this, 'getOrderedGroups', array()); return parent::getOrderedGroups(); }