コード例 #1
0
ファイル: QueryTest.php プロジェクト: jbanety/database
 /**
  * Tests the \Joomla\Database\DatabaseQuery::select method.
  *
  * @return  void
  *
  * @covers  \Joomla\Database\DatabaseQuery::select
  * @since   1.0
  */
 public function testSelect()
 {
     $this->assertThat($this->instance->select('foo'), $this->identicalTo($this->instance), 'Tests chaining.');
     $this->assertThat(TestHelper::getValue($this->instance, 'type'), $this->equalTo('select'), 'Tests the type property is set correctly.');
     $this->assertThat(trim(TestHelper::getValue($this->instance, 'select')), $this->equalTo('SELECT foo'), 'Tests the select element is set correctly.');
     $this->instance->select('bar');
     $this->assertThat(trim(TestHelper::getValue($this->instance, 'select')), $this->equalTo('SELECT foo,bar'), 'Tests the second use appends correctly.');
     $this->instance->select(array('goo', 'car'));
     $this->assertThat(trim(TestHelper::getValue($this->instance, 'select')), $this->equalTo('SELECT foo,bar,goo,car'), 'Tests the second use appends correctly.');
 }