Modify Model set functions to abstract, create Access interactions, do test.
This commit is contained in:
36
_tests/unit/AccessTest.php
Normal file
36
_tests/unit/AccessTest.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
namespace App\Models;
|
||||
|
||||
class AccessTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
/**
|
||||
*
|
||||
* @test
|
||||
*/
|
||||
public function databaseInteractionsSuccess()
|
||||
{
|
||||
$access = new Access();
|
||||
|
||||
$this->assertTrue($access->showAll());
|
||||
|
||||
$args = [
|
||||
'username' => 'gregorio',
|
||||
'password' => 'iniada13charc',
|
||||
];
|
||||
|
||||
$this->assertTrue($access->entry($args));
|
||||
|
||||
$args = [
|
||||
'username' => 'masihgregorio',
|
||||
'password' => 'inijuga3belas'
|
||||
];
|
||||
|
||||
$this->assertTrue($access->update($args, 1));
|
||||
|
||||
$this->assertTrue($access->showSingle(1));
|
||||
|
||||
$this->assertTrue($access->delete(1));
|
||||
|
||||
$this->assertTrue($access->dropTable('user'));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user