コード例 #1
0
 /**
  * test updateAll with empty values.
  *
  * @return void
  */
 function testUpdateAllEmptyValues()
 {
     $this->loadFixtures('Author', 'Post');
     $model = new Author();
     $result = $model->updateAll(array('user' => '""'));
     $this->assertTrue($result);
 }
コード例 #2
0
 /**
  * test updateAll with empty values.
  *
  * @return void
  */
 public function testUpdateAllEmptyValues()
 {
     $this->skipIf($this->db instanceof Sqlserver || $this->db instanceof Postgres, 'This test is not compatible with Postgres or SQL Server.');
     $this->loadFixtures('Author', 'Post');
     $model = new Author();
     $result = $model->updateAll(array('user' => '""'));
     $this->assertTrue($result);
 }
コード例 #3
0
 public function testUpdateAllWithLimitAndOrder()
 {
     if (!$this->conn->acceptsLimitAndOrderForUpdateAndDelete()) {
         $this->markTestSkipped('Only MySQL & Sqlite accept limit/order with UPDATE clause');
     }
     $numAffected = Author::updateAll(array('set' => 'parent_author_id = 2', 'limit' => 1, 'order' => 'name asc'));
     $this->assertEquals(1, $numAffected);
     $this->assertTrue(strpos(Author::table()->lastSql, 'ORDER BY name asc LIMIT 1') !== false);
 }