Make a better database interactions
This commit is contained in:
@@ -7,18 +7,25 @@ class PostTest extends \PHPUnit\Framework\TestCase
|
||||
*
|
||||
* @test
|
||||
*/
|
||||
public function showDataSuccess()
|
||||
public function databaseInteractionsSuccess()
|
||||
{
|
||||
$post = new Post();
|
||||
|
||||
$this->assertTrue($post->showAll());
|
||||
|
||||
$fields = ['category', 'expired_at', 'creator', 'content'];
|
||||
$values = ['3', '2017-09-02', '2', 'barbarbarbarbarbarbar!'];
|
||||
$args = [
|
||||
'category' => 3,
|
||||
'expired_at' => '2017-09-02',
|
||||
'creator' => 2,
|
||||
'content' => 'barbarbarbarbarbarbar!'
|
||||
];
|
||||
|
||||
$this->assertTrue($post->entry($fields, $values));
|
||||
$this->assertTrue($post->entry($args));
|
||||
|
||||
$args = ['category' => 5, 'content' => 'foofoofoofoo!'];
|
||||
$args = [
|
||||
'category' => 5,
|
||||
'content' => 'foofoofoofoo!'
|
||||
];
|
||||
|
||||
$this->assertTrue($post->update($args, 1));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user