mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR: versioning test for SiteTree
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@101166 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
5ab421e946
commit
3dbf07f031
@ -658,6 +658,33 @@ class SiteTreeTest extends SapphireTest {
|
||||
$this->assertTrue($sitetree->validURLSegment(), 'Valid URLSegment values are allowed');
|
||||
}
|
||||
|
||||
public function testVersionsAreCreated() {
|
||||
$p = new Page();
|
||||
$p->Content = "one";
|
||||
$p->write();
|
||||
$this->assertEquals(1, $p->Version);
|
||||
|
||||
// No changes don't bump version
|
||||
$p->write();
|
||||
$this->assertEquals(1, $p->Version);
|
||||
|
||||
$p->Content = "two";
|
||||
$p->write();
|
||||
$this->assertEquals(2, $p->Version);
|
||||
|
||||
// Only change meta-data don't bump version
|
||||
$p->HasBrokenLink = true;
|
||||
$p->write();
|
||||
$p->HasBrokenLink = false;
|
||||
$p->write();
|
||||
$this->assertEquals(2, $p->Version);
|
||||
|
||||
$p->Content = "three";
|
||||
$p->write();
|
||||
$this->assertEquals(3, $p->Version);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**#@+
|
||||
|
Loading…
Reference in New Issue
Block a user