Exemplo n.º 1
0
 /**
  * Tests the JCli::fetchConfigurationData method.
  *
  * @param   string   $fileName      The name of the configuration file.
  * @param   string   $fileName      The name of the configuration file.
  * @param   boolean  $expectsClass  The result is expected to be a class.
  * @param   array    $expects       The expected result as an array.
  *
  * @return  void
  *
  * @dataProvider getFetchConfigurationData
  * @since   11.3
  */
 public function testFetchConfigurationData($file, $class, $expectsClass, $expects, $expectedException = false)
 {
     if ($expectedException) {
         $this->setExpectedException('RuntimeException');
     }
     if (is_null($file) && is_null($class)) {
         $config = $this->inspector->fetchConfigurationData();
     } elseif (is_null($class)) {
         $config = $this->inspector->fetchConfigurationData($file);
     } else {
         $config = $this->inspector->fetchConfigurationData($file, $class);
     }
     if ($expects == 'ConfigEval') {
         $expects = new JConfig();
         $expects = (array) $expects;
     }
     if ($expectsClass) {
         $this->assertInstanceOf($expectsClass, $config, 'Checks the configuration object is the appropriate class.');
     }
     $this->assertThat((array) $config, $this->equalTo($expects), 'Checks the content of the configuration object.');
 }