示例#1
0
 /**
  * Test to make sure we can run a basic insert statement
  *
  * @return  void
  **/
 public function testBasicPush()
 {
     $dbo = $this->getMockDriver();
     $query = new Query($dbo);
     // Try to add a new row
     $query->push('users', ['name' => 'new user', 'email' => '*****@*****.**']);
     // There are 4 default users in the seed data, and adding a new one should a rowcount of 5
     $this->assertEquals(5, $this->getConnection()->getRowCount('users'), 'Push did not return the expected row count of 5');
 }
示例#2
0
 /**
  * Inserts a new row into the database
  *
  * @return  bool
  * @since   2.0.0
  **/
 private function create()
 {
     // Add any automatic fields
     $this->parseAutomatics('initiate');
     return $this->query->push($this->getTableName(), $this->attributes);
 }