This commit is contained in:
2022-11-25 21:21:30 +01:00
parent 2d6df0d5f0
commit 94deb06f52
132 changed files with 44887 additions and 41368 deletions

View File

@@ -1,4 +1,5 @@
<?php
/** DomFramework - Tests
* @package domframework
* @author Dominique Fournier <dominique@fournier38.fr>
@@ -12,40 +13,40 @@ use Domframework\Auth;
/** Test the authentication */
class AuthTest extends \PHPUnit_Framework_TestCase
{
public function test_page_1 ()
{
$auth = new Auth ();
$res = $auth->pageHTML ("http://localhost");
$this->assertSame (!! strpos ($res, "<form "), true);
}
public function test_page_1()
{
$auth = new Auth();
$res = $auth->pageHTML("http://localhost");
$this->assertSame(!! strpos($res, "<form "), true);
}
public function test_Message ()
{
$auth = new Auth ();
$res = $auth->pageHTML ("http://localhost", "MESSAGE");
$this->assertSame (!! strpos ($res, "MESSAGE"), true);
}
public function test_Message()
{
$auth = new Auth();
$res = $auth->pageHTML("http://localhost", "MESSAGE");
$this->assertSame(!! strpos($res, "MESSAGE"), true);
}
public function test_URL_1 ()
{
$auth = new Auth ();
$res = $auth->pageHTML ("http://localhost", "MESSAGE", "URL/TEST");
$this->assertSame (!! strpos ($res, "URL/TEST"), true);
}
public function test_URL_1()
{
$auth = new Auth();
$res = $auth->pageHTML("http://localhost", "MESSAGE", "URL/TEST");
$this->assertSame(!! strpos($res, "URL/TEST"), true);
}
public function test_alreadyAuth_1 ()
{
// Not Authenticated
$auth = new Auth ();
$res = $auth->pageHTML ("http://localhost", "MESSAGE", "URL/TEST", false);
$this->assertSame (!! strpos ($res, "Please sign in"), true);
}
public function test_alreadyAuth_1()
{
// Not Authenticated
$auth = new Auth();
$res = $auth->pageHTML("http://localhost", "MESSAGE", "URL/TEST", false);
$this->assertSame(!! strpos($res, "Please sign in"), true);
}
public function test_alreadyAuth_2 ()
{
// Authenticated
$auth = new Auth ();
$res = $auth->pageHTML ("http://localhost", "", "", "AUTHENTICATED USER");
$this->assertSame (!! strpos ($res, "AUTHENTICATED USER"), true);
}
public function test_alreadyAuth_2()
{
// Authenticated
$auth = new Auth();
$res = $auth->pageHTML("http://localhost", "", "", "AUTHENTICATED USER");
$this->assertSame(!! strpos($res, "AUTHENTICATED USER"), true);
}
}