Bug #23606 ยป 15802_v1.diff

Administrator Admin, 2010-09-24 22:20

View differences:

tests/t3lib/t3lib_iconWorksTest.php (Arbeitskopie)
142 142
	 */
143 143
	public function getSpriteIconWithEmptyStringReturnsSpanWithIconMissingSprite() {
144 144
		$this->assertEquals(
145
			'<span class="t3-icon t3-icon-status t3-icon-status-status t3-icon-status-icon-missing"></span>',
145
			'<span class="t3-icon t3-icon-status t3-icon-status-status t3-icon-status-icon-missing">&nbsp;</span>',
146 146
			t3lib_iconWorks::getSpriteIcon('')
147 147
		);
148 148
	}
......
153 153
	 */
154 154
	public function getSpriteIconWithMissingIconReturnsSpanWithIconMissingSprite() {
155 155
		$this->assertEquals(
156
			'<span class="t3-icon t3-icon-status t3-icon-status-status t3-icon-status-icon-missing"></span>',
156
			'<span class="t3-icon t3-icon-status t3-icon-status-status t3-icon-status-icon-missing">&nbsp;</span>',
157 157
			t3lib_iconWorks::getSpriteIcon('actions-juggle-speed')
158 158
		);
159 159
	}
......
164 164
	 */
165 165
	public function getSpriteIconWithExistingIconReturnsSpanWithIconSprite() {
166 166
		$this->assertEquals(
167
			'<span class="t3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-new"></span>',
167
			'<span class="t3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-new">&nbsp;</span>',
168 168
			t3lib_iconWorks::getSpriteIcon('actions-document-new')
169 169
		);
170 170
	}
......
175 175
	 */
176 176
	public function getSpriteIconWithExistingIconAndAttributeReturnsSpanWithIconSpriteAndAttribute() {
177 177
		$this->assertEquals(
178
			'<span title="foo" class="t3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-new"></span>',
178
			'<span title="foo" class="t3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-new">&nbsp;</span>',
179 179
			t3lib_iconWorks::getSpriteIcon('actions-document-new', array('title' => 'foo'))
180 180
		);
181 181
	}
......
186 186
	 */
187 187
	public function getSpriteIconWithExistingIconAndClassAttributeReturnsSpanWithIconSpriteAndClassAttribute() {
188 188
		$this->assertEquals(
189
			'<span class="t3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-new foo"></span>',
189
			'<span class="t3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-new foo">&nbsp;</span>',
190 190
			t3lib_iconWorks::getSpriteIcon('actions-document-new', array('class' => 'foo'))
191 191
		);
192 192
	}
......
208 208
	 */
209 209
	public function getSpriteIconWithExistingIconAndOverlayReturnsSpanWithIconSpriteAndOverlay() {
210 210
		$result = t3lib_iconWorks::getSpriteIcon('actions-document-new', array(), array('status-overlay-hidden' => array()));
211
		$overlay = '<span class="t3-icon t3-icon-status t3-icon-status-overlay t3-icon-overlay-hidden t3-icon-overlay"></span>';
211
		$overlay = '<span class="t3-icon t3-icon-status t3-icon-status-overlay t3-icon-overlay-hidden t3-icon-overlay">&nbsp;</span>';
212 212
		$this->assertEquals(
213 213
			'<span class="t3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-new">' . $overlay . '</span>',
214 214
			$result
......
241 241
		$result = t3lib_iconWorks::getSpriteIconForRecord('', array());
242 242

  
243 243
		$this->assertEquals(
244
			'<span class="t3-icon t3-icon-status t3-icon-status-status t3-icon-status-icon-missing"></span>',
244
			'<span class="t3-icon t3-icon-status t3-icon-status-status t3-icon-status-icon-missing">&nbsp;</span>',
245 245
			$result
246 246
		);
247 247
	}
......
254 254
		$result = t3lib_iconWorks::getSpriteIconForRecord('tt_content', array());
255 255

  
256 256
		$this->assertEquals(
257
			'<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-x t3-icon-x-content-text"></span>',
257
			'<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-x t3-icon-x-content-text">&nbsp;</span>',
258 258
			$result
259 259
		);
260 260
	}
......
268 268
		$result = t3lib_iconWorks::getSpriteIconForRecord('tt_content', $mockRecord);
269 269

  
270 270
		$this->assertEquals(
271
			'<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-x t3-icon-x-content-text"></span>',
271
			'<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-x t3-icon-x-content-text">&nbsp;</span>',
272 272
			$result
273 273
		);
274 274
	}
......
282 282
		$result = t3lib_iconWorks::getSpriteIconForRecord('tt_content', $mockRecord, array('class' => 'foo', 'title' => 'bar'));
283 283

  
284 284
		$this->assertEquals(
285
			'<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-x t3-icon-x-content-text foo" title="bar"></span>',
285
			'<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-x t3-icon-x-content-text foo" title="bar">&nbsp;</span>',
286 286
			$result
287 287
		);
288 288
	}
......
297 297
		$result = t3lib_iconWorks::getSpriteIconForRecord('tt_content', $mockRecord);
298 298

  
299 299
		$this->assertEquals(
300
			'<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-x t3-icon-x-content-plugin"></span>',
300
			'<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-x t3-icon-x-content-plugin">&nbsp;</span>',
301 301
			$result
302 302
		);
303 303
	}
......
310 310
		$mockRecord = $this->mockRecord;
311 311
		$mockRecord['hidden'] = '1';
312 312
		$result = t3lib_iconWorks::getSpriteIconForRecord('tt_content', $mockRecord);
313
		$overlay = '<span class="t3-icon t3-icon-status t3-icon-status-overlay t3-icon-overlay-hidden t3-icon-overlay"></span>';
313
		$overlay = '<span class="t3-icon t3-icon-status t3-icon-status-overlay t3-icon-overlay-hidden t3-icon-overlay">&nbsp;</span>';
314 314

  
315 315
		$this->assertEquals(
316 316
			'<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-x t3-icon-x-content-text">' . $overlay . '</span>',
......
331 331
		$result = t3lib_iconWorks::getSpriteIconForFile('');
332 332

  
333 333
		$this->assertEquals(
334
			'<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-other t3-icon-other-other"></span>',
334
			'<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-other t3-icon-other-other">&nbsp;</span>',
335 335
			$result
336 336
		);
337 337
	}
......
344 344
		$result = t3lib_iconWorks::getSpriteIconForFile('foo');
345 345

  
346 346
		$this->assertEquals(
347
			'<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-other t3-icon-other-other"></span>',
347
			'<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-other t3-icon-other-other">&nbsp;</span>',
348 348
			$result
349 349
		);
350 350
	}
......
357 357
		$result = t3lib_iconWorks::getSpriteIconForFile('pdf');
358 358

  
359 359
		$this->assertEquals(
360
			'<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-pdf t3-icon-pdf"></span>',
360
			'<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-pdf t3-icon-pdf">&nbsp;</span>',
361 361
			$result
362 362
		);
363 363
	}
......
370 370
		$result = t3lib_iconWorks::getSpriteIconForFile('png');
371 371

  
372 372
		$this->assertEquals(
373
			'<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-media t3-icon-media-image"></span>',
373
			'<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-media t3-icon-media-image">&nbsp;</span>',
374 374
			$result
375 375
		);
376 376
	}
......
383 383
		$result = t3lib_iconWorks::getSpriteIconForFile('png', array('title' => 'bar'));
384 384

  
385 385
		$this->assertEquals(
386
			'<span title="bar" class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-media t3-icon-media-image"></span>',
386
			'<span title="bar" class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-media t3-icon-media-image">&nbsp;</span>',
387 387
			$result
388 388
		);
389 389
	}
    (1-1/1)