xref: /dokuwiki/_test/tests/inc/changelog_hasrevisions.test.php (revision 4069409ef11fca81f86ea3cb126d3d6d55a2890f)
1*4069409eSpeterfromearth<?php
2*4069409eSpeterfromearth
3*4069409eSpeterfromearth/**
4*4069409eSpeterfromearth * Tests for if a page has revisions with hasRevisions()
5*4069409eSpeterfromearth *
6*4069409eSpeterfromearth * This class uses the files:
7*4069409eSpeterfromearth * - data/meta/mailinglist.changes
8*4069409eSpeterfromearth */
9*4069409eSpeterfromearthclass changelog_hasrevisions_test extends DokuWikiTest {
10*4069409eSpeterfromearth
11*4069409eSpeterfromearth    /**
12*4069409eSpeterfromearth     * test page has revisions
13*4069409eSpeterfromearth     */
14*4069409eSpeterfromearth    function test_hasrevisions() {
15*4069409eSpeterfromearth        $id = 'mailinglist';
16*4069409eSpeterfromearth
17*4069409eSpeterfromearth        $pagelog = new PageChangeLog($id);
18*4069409eSpeterfromearth        $result = $pagelog->hasRevisions();
19*4069409eSpeterfromearth        $this->assertTrue($result);
20*4069409eSpeterfromearth    }
21*4069409eSpeterfromearth
22*4069409eSpeterfromearth    /**
23*4069409eSpeterfromearth     * test page has no revisions
24*4069409eSpeterfromearth     */
25*4069409eSpeterfromearth    function test_norevisions() {
26*4069409eSpeterfromearth        $id = 'nonexist';
27*4069409eSpeterfromearth
28*4069409eSpeterfromearth        $pagelog = new PageChangeLog($id);
29*4069409eSpeterfromearth        $result = $pagelog->hasRevisions();
30*4069409eSpeterfromearth        $this->assertFalse($result);
31*4069409eSpeterfromearth    }
32*4069409eSpeterfromearth}
33