[terms] add tests
This commit is contained in:
parent
2f07d4c71c
commit
978d0d629b
1 changed files with 27 additions and 0 deletions
27
ext/terms/test.php
Normal file
27
ext/terms/test.php
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Shimmie2;
|
||||||
|
|
||||||
|
class TermsTest extends ShimmiePHPUnitTestCase
|
||||||
|
{
|
||||||
|
public function testFresh(): void
|
||||||
|
{
|
||||||
|
$this->request('GET', 'post/list', cookies: []);
|
||||||
|
$this->assert_text("terms-modal-enter");
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testLoggedIn(): void
|
||||||
|
{
|
||||||
|
$this->log_in_as_user();
|
||||||
|
$this->request('GET', 'post/list', cookies: []);
|
||||||
|
$this->assert_no_text("terms-modal-enter");
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testCookie(): void
|
||||||
|
{
|
||||||
|
$this->request('GET', 'post/list', cookies: ['shm_accepted_terms' => 'true']);
|
||||||
|
$this->assert_no_text("terms-modal-enter");
|
||||||
|
}
|
||||||
|
}
|
Reference in a new issue