xref: /dokuwiki/_test/tests/inc/changelog_hasrevisions.test.php (revision c7dab4e8843c91451755e1c9569773e6b7614702)
14069409eSpeterfromearth<?php
24069409eSpeterfromearth
3*c7dab4e8SAndreas Gohruse \dokuwiki\ChangeLog\PageChangeLog;
4*c7dab4e8SAndreas Gohr
54069409eSpeterfromearth/**
64069409eSpeterfromearth * Tests for if a page has revisions with hasRevisions()
74069409eSpeterfromearth *
84069409eSpeterfromearth * This class uses the files:
94069409eSpeterfromearth * - data/meta/mailinglist.changes
104069409eSpeterfromearth */
114069409eSpeterfromearthclass changelog_hasrevisions_test extends DokuWikiTest {
124069409eSpeterfromearth
134069409eSpeterfromearth    /**
144069409eSpeterfromearth     * test page has revisions
154069409eSpeterfromearth     */
164069409eSpeterfromearth    function test_hasrevisions() {
174069409eSpeterfromearth        $id = 'mailinglist';
184069409eSpeterfromearth
194069409eSpeterfromearth        $pagelog = new PageChangeLog($id);
204069409eSpeterfromearth        $result = $pagelog->hasRevisions();
214069409eSpeterfromearth        $this->assertTrue($result);
224069409eSpeterfromearth    }
234069409eSpeterfromearth
244069409eSpeterfromearth    /**
254069409eSpeterfromearth     * test page has no revisions
264069409eSpeterfromearth     */
274069409eSpeterfromearth    function test_norevisions() {
284069409eSpeterfromearth        $id = 'nonexist';
294069409eSpeterfromearth
304069409eSpeterfromearth        $pagelog = new PageChangeLog($id);
314069409eSpeterfromearth        $result = $pagelog->hasRevisions();
324069409eSpeterfromearth        $this->assertFalse($result);
334069409eSpeterfromearth    }
344069409eSpeterfromearth}
35