39 lines
793 B
PHP
39 lines
793 B
PHP
<?php
|
|
namespace App\Models;
|
|
|
|
class PostTest extends \PHPUnit\Framework\TestCase
|
|
{
|
|
/**
|
|
*
|
|
* @test
|
|
*/
|
|
public function databaseInteractionsSuccess()
|
|
{
|
|
$post = new Post();
|
|
|
|
$this->assertTrue($post->showAll());
|
|
|
|
$args = [
|
|
'category' => 3,
|
|
'expired_at' => '2017-09-02',
|
|
'creator' => 2,
|
|
'content' => 'barbarbarbarbarbarbar!'
|
|
];
|
|
|
|
$this->assertTrue($post->entry($args));
|
|
|
|
$args = [
|
|
'category' => 5,
|
|
'content' => 'foofoofoofoo!'
|
|
];
|
|
|
|
$this->assertTrue($post->update($args, 1));
|
|
|
|
$this->assertTrue($post->showSingle(1));
|
|
|
|
$this->assertTrue($post->delete(1));
|
|
|
|
$this->assertTrue($post->dropTable('pengumuman'));
|
|
}
|
|
}
|