2009-05-24 14:16:17 +02:00
|
|
|
<?php
|
|
|
|
class ImageTest extends SapphireTest {
|
|
|
|
static $fixture_file = 'sapphire/tests/model/ImageTest.yml';
|
|
|
|
|
|
|
|
function testGetTagWithTitle() {
|
2009-07-08 02:06:16 +02:00
|
|
|
$image = $this->objFromFixture('Image', 'imageWithTitle');
|
2009-05-24 14:16:17 +02:00
|
|
|
$expected = '<img src="' . Director::baseUrl() . 'sapphire/tests/model/testimages/test_image.png" alt="This is a image Title" />';
|
|
|
|
$actual = $image->getTag();
|
|
|
|
|
|
|
|
$this->assertEquals($expected, $actual);
|
|
|
|
}
|
|
|
|
|
|
|
|
function testGetTagWithoutTitle() {
|
2009-07-08 02:06:16 +02:00
|
|
|
$image = $this->objFromFixture('Image', 'imageWithoutTitle');
|
2009-05-24 14:16:17 +02:00
|
|
|
$expected = '<img src="' . Director::baseUrl() . 'sapphire/tests/model/testimages/test_image.png" alt="test_image" />';
|
|
|
|
$actual = $image->getTag();
|
|
|
|
|
|
|
|
$this->assertEquals($expected, $actual);
|
|
|
|
}
|
|
|
|
|
|
|
|
function testGetTagWithoutTitleContainingDots() {
|
2009-07-08 02:06:16 +02:00
|
|
|
$image = $this->objFromFixture('Image', 'imageWithoutTitleContainingDots');
|
2009-05-24 14:16:17 +02:00
|
|
|
$expected = '<img src="' . Director::baseUrl() . 'sapphire/tests/model/testimages/test.image.with.dots.png" alt="test.image.with.dots" />';
|
|
|
|
$actual = $image->getTag();
|
|
|
|
|
|
|
|
$this->assertEquals($expected, $actual);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|