Exemplo n.º 1
0
 public function setUp()
 {
     parent::setUp();
     $user57 = $this->model->getById('57');
     if (count($user57) === 0) {
         $this->model->insert(['id' => 57, 'username' => '*****@*****.**', 'password' => '123456', 'role' => 'ROLE_ADMIN']);
     }
 }
Exemplo n.º 2
0
 public function setUp()
 {
     parent::setUp();
     $article57 = $this->model->getById('57');
     if (count($article57) === 0) {
         $this->model->insert(['id' => 57, 'name' => 'Tesing from UnitTest', 'content' => 'This is testing content', 'author' => '57']);
     }
     $comments = $this->comment->getCommentsByArticleId('57');
     if (count($comments) === 0) {
         $this->comment->insert(['content' => 'This is first testing comment', 'article_id' => 57, 'user_id' => 57]);
         $this->comment->insert(['content' => 'This is second testing comment', 'article_id' => 57, 'user_id' => 57]);
         $this->comment->insert(['content' => 'This is third testing comment', 'article_id' => 57, 'user_id' => 57]);
     }
 }