TYPO3 CMS  TYPO3_6-2
SpriteManagerTest.php
Go to the documentation of this file.
1 <?php
3 
18 
25 
27  // Tests concerning addTcaTypeIcon
29 
34  $this->assertArrayHasKey('tcarecords--', $GLOBALS['TBE_STYLES']['spritemanager']['singleIcons']);
35  }
36 
42  $this->assertEquals('', $GLOBALS['TBE_STYLES']['spritemanager']['singleIcons']['tcarecords--']);
43  }
44 
49  $table = 'tt_content';
50  $type = 'contains-news';
51  SpriteManager::addTcaTypeIcon($table, $type, '');
52  $this->assertArrayHasKey('tcarecords-' . $table . '-' . $type, $GLOBALS['TBE_STYLES']['spritemanager']['singleIcons']);
53  }
54 
59  $imagePath = 'path/to/my-icon.png';
60  $table = 'tt_content';
61  $type = 'contains-news';
62  SpriteManager::addTcaTypeIcon($table, $type, $imagePath);
63  $this->assertEquals($imagePath, $GLOBALS['TBE_STYLES']['spritemanager']['singleIcons']['tcarecords-' . $table . '-' . $type]);
64  }
65 
67  // Tests concerning addSingleIcons
69 
73  $type = '';
74  $imagePath = 'path/to/my-icon.png';
75  $icons = array($type => $imagePath);
76  $extensionKey = 'dummy';
77  SpriteManager::addSingleIcons($icons, $extensionKey);
78  $this->assertArrayHasKey('extensions-' . $extensionKey . '-' . $type, $GLOBALS['TBE_STYLES']['spritemanager']['singleIcons']);
79  }
80 
85  $type = '';
86  $imagePath = 'path/to/my-icon.png';
87  $icons = array($type => $imagePath);
88  $extensionKey = 'dummy';
89  SpriteManager::addSingleIcons($icons, $extensionKey);
90  $this->assertEquals($imagePath, $GLOBALS['TBE_STYLES']['spritemanager']['singleIcons']['extensions-' . $extensionKey . '-' . $type]);
91  }
92 
97  $type = 'contains-news';
98  $imagePath = 'path/to/my-icon.png';
99  $icons = array($type => $imagePath);
100  $extensionKey = 'dummy';
101  SpriteManager::addSingleIcons($icons, $extensionKey);
102  $this->assertArrayHasKey('extensions-' . $extensionKey . '-' . $type, $GLOBALS['TBE_STYLES']['spritemanager']['singleIcons']);
103  }
104 
109  $type = 'contains-news';
110  $imagePath = 'path/to/my-icon.png';
111  $icons = array($type => $imagePath);
112  $extensionKey = 'dummy';
113  SpriteManager::addSingleIcons($icons, $extensionKey);
114  $this->assertEquals($imagePath, $GLOBALS['TBE_STYLES']['spritemanager']['singleIcons']['extensions-' . $extensionKey . '-' . $type]);
115  }
116 
117 }
static addTcaTypeIcon($table, $type, $iconFile)
static addSingleIcons(array $icons, $extKey='')
if(!defined('TYPO3_MODE')) if(TYPO3_MODE=='BE' &&!(TYPO3_REQUESTTYPE &TYPO3_REQUESTTYPE_INSTALL)) $icons
Definition: ext_tables.php:52
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]