Example #1
0
 public function testInsertPosts()
 {
     $result = DB::insert("INSERT INTO `posts` (`id`, `slug`, `tags`, `title`, `content`, `created`, `published`, `user_id`) VALUES (NULL, '2014-08-test1', '', 'test', 'test', '0000-00-00 00:00:00', NULL, 1);");
     $this->assertNotFalse($result, 'insert post failed 1');
     $this->assertEquals(1, $result);
     $result = DB::insert("INSERT INTO `posts` (`id`, `slug`, `tags`, `title`, `content`, `created`, `published`, `user_id`) VALUES (NULL, '2014-08-test2', '', 'test', 'test', '0000-00-00 00:00:00', NULL, 1);");
     $this->assertNotFalse($result, 'insert post failed 2');
     $this->assertEquals(2, $result);
 }