Bug #23606 ยป 15802_v1.diff
tests/t3lib/t3lib_iconWorksTest.php (Arbeitskopie) | ||
---|---|---|
*/
|
||
public function getSpriteIconWithEmptyStringReturnsSpanWithIconMissingSprite() {
|
||
$this->assertEquals(
|
||
'<span class="t3-icon t3-icon-status t3-icon-status-status t3-icon-status-icon-missing"></span>',
|
||
'<span class="t3-icon t3-icon-status t3-icon-status-status t3-icon-status-icon-missing"> </span>',
|
||
t3lib_iconWorks::getSpriteIcon('')
|
||
);
|
||
}
|
||
... | ... | |
*/
|
||
public function getSpriteIconWithMissingIconReturnsSpanWithIconMissingSprite() {
|
||
$this->assertEquals(
|
||
'<span class="t3-icon t3-icon-status t3-icon-status-status t3-icon-status-icon-missing"></span>',
|
||
'<span class="t3-icon t3-icon-status t3-icon-status-status t3-icon-status-icon-missing"> </span>',
|
||
t3lib_iconWorks::getSpriteIcon('actions-juggle-speed')
|
||
);
|
||
}
|
||
... | ... | |
*/
|
||
public function getSpriteIconWithExistingIconReturnsSpanWithIconSprite() {
|
||
$this->assertEquals(
|
||
'<span class="t3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-new"></span>',
|
||
'<span class="t3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-new"> </span>',
|
||
t3lib_iconWorks::getSpriteIcon('actions-document-new')
|
||
);
|
||
}
|
||
... | ... | |
*/
|
||
public function getSpriteIconWithExistingIconAndAttributeReturnsSpanWithIconSpriteAndAttribute() {
|
||
$this->assertEquals(
|
||
'<span title="foo" class="t3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-new"></span>',
|
||
'<span title="foo" class="t3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-new"> </span>',
|
||
t3lib_iconWorks::getSpriteIcon('actions-document-new', array('title' => 'foo'))
|
||
);
|
||
}
|
||
... | ... | |
*/
|
||
public function getSpriteIconWithExistingIconAndClassAttributeReturnsSpanWithIconSpriteAndClassAttribute() {
|
||
$this->assertEquals(
|
||
'<span class="t3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-new foo"></span>',
|
||
'<span class="t3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-new foo"> </span>',
|
||
t3lib_iconWorks::getSpriteIcon('actions-document-new', array('class' => 'foo'))
|
||
);
|
||
}
|
||
... | ... | |
*/
|
||
public function getSpriteIconWithExistingIconAndOverlayReturnsSpanWithIconSpriteAndOverlay() {
|
||
$result = t3lib_iconWorks::getSpriteIcon('actions-document-new', array(), array('status-overlay-hidden' => array()));
|
||
$overlay = '<span class="t3-icon t3-icon-status t3-icon-status-overlay t3-icon-overlay-hidden t3-icon-overlay"></span>';
|
||
$overlay = '<span class="t3-icon t3-icon-status t3-icon-status-overlay t3-icon-overlay-hidden t3-icon-overlay"> </span>';
|
||
$this->assertEquals(
|
||
'<span class="t3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-new">' . $overlay . '</span>',
|
||
$result
|
||
... | ... | |
$result = t3lib_iconWorks::getSpriteIconForRecord('', array());
|
||
$this->assertEquals(
|
||
'<span class="t3-icon t3-icon-status t3-icon-status-status t3-icon-status-icon-missing"></span>',
|
||
'<span class="t3-icon t3-icon-status t3-icon-status-status t3-icon-status-icon-missing"> </span>',
|
||
$result
|
||
);
|
||
}
|
||
... | ... | |
$result = t3lib_iconWorks::getSpriteIconForRecord('tt_content', array());
|
||
$this->assertEquals(
|
||
'<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-x t3-icon-x-content-text"></span>',
|
||
'<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-x t3-icon-x-content-text"> </span>',
|
||
$result
|
||
);
|
||
}
|
||
... | ... | |
$result = t3lib_iconWorks::getSpriteIconForRecord('tt_content', $mockRecord);
|
||
$this->assertEquals(
|
||
'<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-x t3-icon-x-content-text"></span>',
|
||
'<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-x t3-icon-x-content-text"> </span>',
|
||
$result
|
||
);
|
||
}
|
||
... | ... | |
$result = t3lib_iconWorks::getSpriteIconForRecord('tt_content', $mockRecord, array('class' => 'foo', 'title' => 'bar'));
|
||
$this->assertEquals(
|
||
'<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-x t3-icon-x-content-text foo" title="bar"></span>',
|
||
'<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-x t3-icon-x-content-text foo" title="bar"> </span>',
|
||
$result
|
||
);
|
||
}
|
||
... | ... | |
$result = t3lib_iconWorks::getSpriteIconForRecord('tt_content', $mockRecord);
|
||
$this->assertEquals(
|
||
'<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-x t3-icon-x-content-plugin"></span>',
|
||
'<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-x t3-icon-x-content-plugin"> </span>',
|
||
$result
|
||
);
|
||
}
|
||
... | ... | |
$mockRecord = $this->mockRecord;
|
||
$mockRecord['hidden'] = '1';
|
||
$result = t3lib_iconWorks::getSpriteIconForRecord('tt_content', $mockRecord);
|
||
$overlay = '<span class="t3-icon t3-icon-status t3-icon-status-overlay t3-icon-overlay-hidden t3-icon-overlay"></span>';
|
||
$overlay = '<span class="t3-icon t3-icon-status t3-icon-status-overlay t3-icon-overlay-hidden t3-icon-overlay"> </span>';
|
||
$this->assertEquals(
|
||
'<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-x t3-icon-x-content-text">' . $overlay . '</span>',
|
||
... | ... | |
$result = t3lib_iconWorks::getSpriteIconForFile('');
|
||
$this->assertEquals(
|
||
'<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-other t3-icon-other-other"></span>',
|
||
'<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-other t3-icon-other-other"> </span>',
|
||
$result
|
||
);
|
||
}
|
||
... | ... | |
$result = t3lib_iconWorks::getSpriteIconForFile('foo');
|
||
$this->assertEquals(
|
||
'<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-other t3-icon-other-other"></span>',
|
||
'<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-other t3-icon-other-other"> </span>',
|
||
$result
|
||
);
|
||
}
|
||
... | ... | |
$result = t3lib_iconWorks::getSpriteIconForFile('pdf');
|
||
$this->assertEquals(
|
||
'<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-pdf t3-icon-pdf"></span>',
|
||
'<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-pdf t3-icon-pdf"> </span>',
|
||
$result
|
||
);
|
||
}
|
||
... | ... | |
$result = t3lib_iconWorks::getSpriteIconForFile('png');
|
||
$this->assertEquals(
|
||
'<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-media t3-icon-media-image"></span>',
|
||
'<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-media t3-icon-media-image"> </span>',
|
||
$result
|
||
);
|
||
}
|
||
... | ... | |
$result = t3lib_iconWorks::getSpriteIconForFile('png', array('title' => 'bar'));
|
||
$this->assertEquals(
|
||
'<span title="bar" class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-media t3-icon-media-image"></span>',
|
||
'<span title="bar" class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-media t3-icon-media-image"> </span>',
|
||
$result
|
||
);
|
||
}
|