mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX: Fixed FileLinkTrackingTest to cope with the empty alt="" and title="" attributes that are created
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@101129 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
3aad86d9be
commit
c7a97ae95f
@ -26,15 +26,15 @@ class FileLinkTrackingTest extends SapphireTest {
|
|||||||
function testFileRenameUpdatesDraftAndPublishedPages() {
|
function testFileRenameUpdatesDraftAndPublishedPages() {
|
||||||
$page = $this->objFromFixture('Page', 'page1');
|
$page = $this->objFromFixture('Page', 'page1');
|
||||||
$this->assertTrue($page->doPublish());
|
$this->assertTrue($page->doPublish());
|
||||||
$this->assertContains('<img src="assets/testscript-test-file.pdf" />',
|
$this->assertContains('<img src="assets/testscript-test-file.pdf"',
|
||||||
DB::query("SELECT \"Content\" FROM \"SiteTree_Live\" WHERE \"ID\" = $page->ID")->value());
|
DB::query("SELECT \"Content\" FROM \"SiteTree_Live\" WHERE \"ID\" = $page->ID")->value());
|
||||||
|
|
||||||
$file = $this->objFromFixture('File', 'file1');
|
$file = $this->objFromFixture('File', 'file1');
|
||||||
$file->Name = 'renamed-test-file.pdf';
|
$file->Name = 'renamed-test-file.pdf';
|
||||||
|
|
||||||
$this->assertContains('<img src="assets/renamed-test-file.pdf" />',
|
$this->assertContains('<img src="assets/renamed-test-file.pdf"',
|
||||||
DB::query("SELECT \"Content\" FROM \"SiteTree\" WHERE \"ID\" = $page->ID")->value());
|
DB::query("SELECT \"Content\" FROM \"SiteTree\" WHERE \"ID\" = $page->ID")->value());
|
||||||
$this->assertContains('<img src="assets/renamed-test-file.pdf" />',
|
$this->assertContains('<img src="assets/renamed-test-file.pdf"',
|
||||||
DB::query("SELECT \"Content\" FROM \"SiteTree_Live\" WHERE \"ID\" = $page->ID")->value());
|
DB::query("SELECT \"Content\" FROM \"SiteTree_Live\" WHERE \"ID\" = $page->ID")->value());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54,9 +54,9 @@ class FileLinkTrackingTest extends SapphireTest {
|
|||||||
$file->Name = 'renamed-test-file.pdf';
|
$file->Name = 'renamed-test-file.pdf';
|
||||||
|
|
||||||
// Verify that the draft and publish virtual pages both have the corrected link
|
// Verify that the draft and publish virtual pages both have the corrected link
|
||||||
$this->assertContains('<img src="assets/renamed-test-file.pdf" />',
|
$this->assertContains('<img src="assets/renamed-test-file.pdf"',
|
||||||
DB::query("SELECT \"Content\" FROM \"SiteTree\" WHERE \"ID\" = $svp->ID")->value());
|
DB::query("SELECT \"Content\" FROM \"SiteTree\" WHERE \"ID\" = $svp->ID")->value());
|
||||||
$this->assertContains('<img src="assets/renamed-test-file.pdf" />',
|
$this->assertContains('<img src="assets/renamed-test-file.pdf"',
|
||||||
DB::query("SELECT \"Content\" FROM \"SiteTree_Live\" WHERE \"ID\" = $svp->ID")->value());
|
DB::query("SELECT \"Content\" FROM \"SiteTree_Live\" WHERE \"ID\" = $svp->ID")->value());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,7 +81,7 @@ class FileLinkTrackingTest extends SapphireTest {
|
|||||||
function testTwoFileRenamesInARowWork() {
|
function testTwoFileRenamesInARowWork() {
|
||||||
$page = $this->objFromFixture('Page', 'page1');
|
$page = $this->objFromFixture('Page', 'page1');
|
||||||
$this->assertTrue($page->doPublish());
|
$this->assertTrue($page->doPublish());
|
||||||
$this->assertContains('<img src="assets/testscript-test-file.pdf" />',
|
$this->assertContains('<img src="assets/testscript-test-file.pdf"',
|
||||||
DB::query("SELECT \"Content\" FROM \"SiteTree_Live\" WHERE \"ID\" = $page->ID")->value());
|
DB::query("SELECT \"Content\" FROM \"SiteTree_Live\" WHERE \"ID\" = $page->ID")->value());
|
||||||
|
|
||||||
// Rename the file twice
|
// Rename the file twice
|
||||||
@ -93,9 +93,9 @@ class FileLinkTrackingTest extends SapphireTest {
|
|||||||
$file->write();
|
$file->write();
|
||||||
|
|
||||||
// Confirm that the correct image is shown in both the draft and live site
|
// Confirm that the correct image is shown in both the draft and live site
|
||||||
$this->assertContains('<img src="assets/renamed-test-file-second-time.pdf" />',
|
$this->assertContains('<img src="assets/renamed-test-file-second-time.pdf"',
|
||||||
DB::query("SELECT \"Content\" FROM \"SiteTree\" WHERE \"ID\" = $page->ID")->value());
|
DB::query("SELECT \"Content\" FROM \"SiteTree\" WHERE \"ID\" = $page->ID")->value());
|
||||||
$this->assertContains('<img src="assets/renamed-test-file-second-time.pdf" />',
|
$this->assertContains('<img src="assets/renamed-test-file-second-time.pdf"',
|
||||||
DB::query("SELECT \"Content\" FROM \"SiteTree_Live\" WHERE \"ID\" = $page->ID")->value());
|
DB::query("SELECT \"Content\" FROM \"SiteTree_Live\" WHERE \"ID\" = $page->ID")->value());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user