]> BookStack Code Mirror - bookstack/blob - tests/ActivityTrackingTest.php
LDAP: Added TLS support
[bookstack] / tests / ActivityTrackingTest.php
1 <?php namespace Tests;
2
3
4 use BookStack\Entities\Book;
5
6 class ActivityTrackingTest extends BrowserKitTest
7 {
8
9     public function test_recently_viewed_books()
10     {
11         $books = Book::all()->take(10);
12
13         $this->asAdmin()->visit('/books')
14             ->dontSeeInElement('#recents', $books[0]->name)
15             ->dontSeeInElement('#recents', $books[1]->name)
16             ->visit($books[0]->getUrl())
17             ->visit($books[1]->getUrl())
18             ->visit('/books')
19             ->seeInElement('#recents', $books[0]->name)
20             ->seeInElement('#recents', $books[1]->name);
21     }
22
23     public function test_popular_books()
24     {
25         $books = Book::all()->take(10);
26
27         $this->asAdmin()->visit('/books')
28             ->dontSeeInElement('#popular', $books[0]->name)
29             ->dontSeeInElement('#popular', $books[1]->name)
30             ->visit($books[0]->getUrl())
31             ->visit($books[1]->getUrl())
32             ->visit($books[0]->getUrl())
33             ->visit('/books')
34             ->seeInNthElement('#popular .book', 0, $books[0]->name)
35             ->seeInNthElement('#popular .book', 1, $books[1]->name);
36     }
37 }
Morty Proxy This is a proxified and sanitized view of the page, visit original site.