Source of file FutureStateFunctionalTest.php
Size: 1,196 Bytes - Last Modified: 2021-12-23T10:28:49+00:00
/var/www/docs.ssmods.com/process/src/tests/FutureStateFunctionalTest.php
1234567891011121314151617181920212223242526272829303132333435363738 | <?php class FutureStateFunctionalTest extends FunctionalTest { public static $fixture_file = 'cmsworkflow/tests/SiteTreeFutureStateTest.yml'; public function testFutureStateAsksForLogIn() { $this->autoFollowRedirection = false; $response = $this->get('/about-us?futureDate=2020-10-10+10:00:00'); $this->assertEquals(302, $response->getStatusCode()); $this->assertContains('Security/login', $response->getHeader('Location')); } /////////////////////////////////////////////////////////////////////////////////////////// public function setUp() { parent::setUp(); // Publish all but the embargoed content and switch view to Live $pages = array('home', 'about', 'staff', 'staffduplicate','products', 'product1', 'product2', 'contact', 'virtuals'); Versioned::reading_stage('Stage'); $this->logInWithPermission('ADMIN'); foreach ($pages as $page) { $this->assertTrue($this->objFromFixture('Page', $page)->doPublish()); } $this->get('Security/logout'); Versioned::reading_stage('Live'); } } |