MINOR Fixed broken test

This commit is contained in:
Sean Harvey 2010-03-16 23:22:42 +00:00
parent 47d35fcca1
commit a9ce309881

View File

@ -69,21 +69,20 @@ class SubsitesVirtualPageTest extends SapphireTest {
$page = $this->objFromFixture('Page', 'page1'); $page = $this->objFromFixture('Page', 'page1');
$this->assertTrue($page->doPublish()); $this->assertTrue($page->doPublish());
// Create a virtual page from it, and publish that
$svp = new SubsitesVirtualPage(); $svp = new SubsitesVirtualPage();
$svp->CopyContentFromID = $page->ID; $svp->CopyContentFromID = $page->ID;
$svp->write(); $svp->write();
$svp->doPublish(); $svp->doPublish();
// Create a virtual page from it, and publish that
// Rename the file // Rename the file
$file = $this->objFromFixture('File', 'file1'); $file = $this->objFromFixture('File', 'file1');
$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());
// File teardown // File teardown