コード例 #1
0
 /**
  * Test for FOR UPDATE clause.
  *
  * @return  void
  *
  * @since   11.3
  */
 public function testForUpdate()
 {
     $q = new JDatabaseQueryPostgresql($this->dbo);
     $this->assertThat($q->forUpdate('#__foo'), $this->identicalTo($q), 'Tests chaining.');
     $this->assertThat(trim($q->forUpdate), $this->equalTo('FOR UPDATE OF #__foo'), 'Tests rendered value.');
     $q->forUpdate('#__bar');
     $this->assertThat(trim($q->forUpdate), $this->equalTo('FOR UPDATE OF #__foo, #__bar'), 'Tests rendered value.');
     // Testing glue
     TestReflection::setValue($q, 'forUpdate', null);
     $q->forUpdate('#__foo', ';');
     $q->forUpdate('#__bar');
     $this->assertThat(trim($q->forUpdate), $this->equalTo('FOR UPDATE OF #__foo; #__bar'), 'Tests rendered value.');
 }