_column() public method

Split a column name into its parts
public _column ( string $col )
$col string column name
Esempio n. 1
0
 function testColumn()
 {
     global $conf;
     $helper = new helper_plugin_data();
     $this->assertEquals($this->createColumnEntry('type', false, 'type', 'type', ''), $helper->_column('type'));
     $this->assertEquals($this->createColumnEntry('types', true, 'type', 'type', ''), $helper->_column('types'));
     $this->assertEquals($this->createColumnEntry('', false, '', '', ''), $helper->_column(''));
     $this->assertEquals($this->createColumnEntry('type_url', false, 'type', 'type', 'url'), $helper->_column('type_url'));
     $this->assertEquals($this->createColumnEntry('type_urls', true, 'type', 'type', 'url'), $helper->_column('type_urls'));
     $this->assertEquals($this->createColumnEntry('type_hidden', false, 'type', 'type', 'hidden'), $helper->_column('type_hidden'));
     $this->assertEquals($this->createColumnEntry('type_hiddens', true, 'type', 'type', 'hidden'), $helper->_column('type_hiddens'));
     $this->assertEquals($this->createColumnEntry('%title%', false, '%title%', 'Page', 'title'), $helper->_column('%title%'));
     $this->assertEquals($this->createColumnEntry('%pageid%', false, '%pageid%', 'Title', 'page'), $helper->_column('%pageid%'));
     $this->assertEquals($this->createColumnEntry('%class%', false, '%class%', 'Page Class', ''), $helper->_column('%class%'));
     $this->assertEquals($this->createColumnEntry('%lastmod%', false, '%lastmod%', 'Last Modified', 'timestamp'), $helper->_column('%lastmod%'));
     // test translated key name
     $this->assertEquals($this->createColumnEntry('trans_urls', true, 'trans', 'Translated Title', 'url'), $helper->_column('trans_urls'));
     // retry in different language
     $conf['lang'] = 'de';
     $helper = new helper_plugin_data();
     $this->assertEquals($this->createColumnEntry('trans_urls', true, 'trans', 'Übersetzter Titel', 'url'), $helper->_column('trans_urls'));
 }