1 <?php namespace Entity;
7 class PageRevisionTest extends TestCase
10 public function test_page_revision_count_increments_on_update()
12 $page = Page::first();
13 $startCount = $page->revision_count;
15 $resp = $this->asEditor()->put($page->getUrl(), ['name' => 'Updated page', 'html' => 'new page html', 'summary' => 'Update a']);
16 $resp->assertStatus(302);
18 $this->assertTrue(Page::find($page->id)->revision_count === $startCount+1);
21 public function test_revision_count_shown_in_page_meta()
23 $page = Page::first();
24 $this->asEditor()->put($page->getUrl(), ['name' => 'Updated page', 'html' => 'new page html', 'summary' => 'Update a']);
25 $this->asEditor()->put($page->getUrl(), ['name' => 'Updated page', 'html' => 'new page html', 'summary' => 'Update a']);
26 $page = Page::find($page->id);
28 $pageView = $this->get($page->getUrl());
29 $pageView->assertSee('Revision #' . $page->revision_count);