32 lines
718 B
PHP
32 lines
718 B
PHP
<?php
|
|
namespace App\Models;
|
|
|
|
class PostTest extends \PHPUnit\Framework\TestCase
|
|
{
|
|
/**
|
|
*
|
|
* @test
|
|
*/
|
|
public function showDataSuccess()
|
|
{
|
|
$post = new Post();
|
|
|
|
$this->assertTrue($post->showAll());
|
|
|
|
$fields = ['category', 'expired_at', 'creator', 'content'];
|
|
$values = ['3', '2017-09-02', '2', 'barbarbarbarbarbarbar!'];
|
|
|
|
$this->assertTrue($post->entry($fields, $values));
|
|
|
|
$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'));
|
|
}
|
|
}
|