protected function getLabel() { $label = parent::getLabel(); $default = $this->getPropertyValue('default'); if ($label != $default) { $label = set_datepicker_date_format($label); } return $label; }
public function testConditionalLinkableCells() { $dataObject = new LinkCellTestDataObject(); $conditionalParams = new sfOutputEscaperArrayDecorator('', array(3)); $this->linkCell->setDataObject($dataObject); $this->linkCell->setProperties(array('labelGetter' => 'getLabel', 'linkable' => array('isEven', $conditionalParams), 'placeholderGetters' => array('id' => 'getId', 'status' => 'getCurrentState'), 'urlPattern' => 'index.php?id={id}&status={status}')); $expectedLink = 'Label'; $this->assertEquals($expectedLink, $this->linkCell->__toString()); $conditionalParams = new sfOutputEscaperArrayDecorator('', array(2)); $this->linkCell->setProperties(array('labelGetter' => 'getLabel', 'linkable' => array('isEven', $conditionalParams), 'placeholderGetters' => array('id' => 'getId', 'status' => 'getCurrentState'), 'urlPattern' => 'index.php?id={id}&status={status}')); $expectedLink = '<a href="http://' . $_SERVER['PHP_SELF'] . '/index.php?id=1&status=active">Label</a>'; $this->assertEquals($expectedLink, $this->linkCell->__toString()); }