/** * Testing methods used by the instantiated object. * * @return void */ public function testConstruct() { $form = new JFormInspector('form1'); $this->assertThat($form instanceof JForm, $this->isTrue(), 'Line:' . __LINE__ . ' The JForm constuctor should return a JForm object.'); // Check the integrity of the options. $options = $form->getOptions(); $this->assertThat(isset($options['control']), $this->isTrue(), 'Line:' . __LINE__ . ' The JForm object should contain an options array with a control setting.'); $options = $form->getOptions(); $this->assertThat($options['control'], $this->isFalse(), 'Line:' . __LINE__ . ' The control setting should be false by default.'); $form = new JFormInspector('form1', array('control' => 'jform')); $options = $form->getOptions(); $this->assertThat($options['control'], $this->equalTo('jform'), 'Line:' . __LINE__ . ' The control setting should be what is passed in the constructor.'); }