lepisi-pengumuman/_tests/unit/AccessTest.php
Gregorio Chiko Putra 62430ff905 - Methods that are same (e.g. entry(), update(), delete(), etc.) defined in the parent.
- Added function when entry multiple rows (in this case is when putting
categories).
- Do test.
2017-09-04 10:37:25 +07:00

37 lines
802 B
PHP

<?php
namespace App\Models;
class AccessTest extends \PHPUnit\Framework\TestCase
{
/**
*
* @test
*/
public function databaseInteractionsSuccess()
{
$access = new Access();
$this->assertTrue($access->showAll());
$user_entry = [
'username' => 'gregorio',
'password' => 'iniada13charc',
];
$this->assertTrue($access->entry('user', $user_entry));
$user_update = [
'username' => 'masihgregorio',
'password' => 'inijuga3belas'
];
$this->assertTrue($access->update('user', $user_update, 1));
$this->assertTrue($access->showSingle(1));
$this->assertTrue($access->delete('user', 1));
$this->assertTrue($access->dropTable('user'));
}
}