mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
f3959b038d
ENHANCEMENT Allowing multiple fixtures to be defined in SapphireTest::$fixture_file through array notation. BUGFIX Disabling DataObject validation in YamlFixture->saveIntoDatabase() instead of SapphireTest->setUp() MINOR Adapted sapphire unit tests to deprecated $this->fixture usage git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@81286 467b73ca-7a2a-4603-9d3b-597d59a354a9
29 lines
1.1 KiB
PHP
29 lines
1.1 KiB
PHP
<?php
|
|
class ImageTest extends SapphireTest {
|
|
static $fixture_file = 'sapphire/tests/model/ImageTest.yml';
|
|
|
|
function testGetTagWithTitle() {
|
|
$image = $this->objFromFixture('Image', 'imageWithTitle');
|
|
$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() {
|
|
$image = $this->objFromFixture('Image', 'imageWithoutTitle');
|
|
$expected = '<img src="' . Director::baseUrl() . 'sapphire/tests/model/testimages/test_image.png" alt="test_image" />';
|
|
$actual = $image->getTag();
|
|
|
|
$this->assertEquals($expected, $actual);
|
|
}
|
|
|
|
function testGetTagWithoutTitleContainingDots() {
|
|
$image = $this->objFromFixture('Image', 'imageWithoutTitleContainingDots');
|
|
$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);
|
|
}
|
|
}
|
|
?>
|