/** * Tests the setDbo method with the wrong type of class. * * @return void * @since 11.1 */ public function testSetDboWithGoodInput() { $instance = new JDatabaseImporterMysqli(); try { $result = $instance->setDbo($this->dbo); $this->assertThat($result, $this->identicalTo($instance), 'setDbo must return an object to support chaining.'); } catch (PHPUnit_Framework_Error $e) { // Unknown error has occurred. $this->fail($e->getMessage()); } }
/** * Tests the withStructure method. */ public function testWithStructure() { $instance = new JDatabaseImporterMysqli(); $result = $instance->withStructure(); $this->assertThat($result, $this->identicalTo($instance), 'withStructure must return an object to support chaining.'); $options = TestReflection::getValue($instance, 'options'); $this->assertThat($options->withStructure, $this->isTrue(), 'The default use of withStructure should result in true.'); $instance->withStructure(true); $options = TestReflection::getValue($instance, 'options'); $this->assertThat($options->withStructure, $this->isTrue(), 'The explicit use of withStructure with true should result in true.'); $instance->withStructure(false); $options = TestReflection::getValue($instance, 'options'); $this->assertThat($options->withStructure, $this->isFalse(), 'The explicit use of withStructure with false should result in false.'); }
/** * Exposes the protected withStructure method. * * @param boolean $setting True to export the structure, false to not. * * @return void * * @since 11.1 */ public function withStructure($setting = true) { return parent::withStructure($setting); }