From 55214b3e2409114e5973fe6a297e531e861f6788 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Tue, 29 Jun 2010 06:10:16 +0000 Subject: [PATCH] MINOR Adapted SubsitesVirtualPageTest to changed File API (see r107268) --- tests/SubsitesVirtualPageTest.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/SubsitesVirtualPageTest.php b/tests/SubsitesVirtualPageTest.php index d0183dd..f34fd8d 100644 --- a/tests/SubsitesVirtualPageTest.php +++ b/tests/SubsitesVirtualPageTest.php @@ -6,6 +6,26 @@ class SubsitesVirtualPageTest extends SapphireTest { 'sapphire/tests/FileLinkTrackingTest.yml', ); + function setUp() { + parent::setUp(); + $this->logInWithPermission('ADMIN'); + + $fh = fopen(Director::baseFolder() . '/assets/testscript-test-file.pdf', "w"); + fwrite($fh, str_repeat('x',1000000)); + fclose($fh); + } + function tearDown() { + parent::tearDown(); + $testFiles = array( + '/assets/testscript-test-file.pdf', + '/assets/renamed-test-file.pdf', + '/assets/renamed-test-file-second-time.pdf', + ); + foreach($testFiles as $file) { + if(file_exists(Director::baseFolder().$file)) unlink(Director::baseFolder().$file); + } + } + // Attempt to bring main:linky to subsite2:linky function testVirtualPageFromAnotherSubsite() { Subsite::$write_hostmap = false; @@ -78,6 +98,7 @@ class SubsitesVirtualPageTest extends SapphireTest { // Rename the file $file = $this->objFromFixture('File', 'file1'); $file->Name = 'renamed-test-file.pdf'; + $file->write(); // Verify that the draft and publish virtual pages both have the corrected link $this->assertContains('