Permalink
Browse files

Merge pull request #511 from ianmacl/testtweaks

Some minor changes to improve exceptions and fix unit test issues with PHPUnit 3.6
  • Loading branch information...
2 parents e2e355d + fa6a97b commit 8e73e52db794364a4dbe65f137bb3e7956c31000 @LouisLandry LouisLandry committed Nov 12, 2011
@@ -365,7 +365,7 @@ protected function fetchConfigurationData($file = '', $class = 'JConfig')
}
else
{
- throw new Exception('Configuration class does not exist.');
+ throw new RuntimeException('Configuration class does not exist.');
}
}
@@ -287,7 +287,7 @@ public static function getInstance($prefix, $config = array())
}
else
{
- throw new Exception(JText::sprintf('JLIB_APPLICATION_ERROR_INVALID_CONTROLLER', $type, $format));
+ throw new InvalidArgumentException(JText::sprintf('JLIB_APPLICATION_ERROR_INVALID_CONTROLLER', $type, $format));
}
}
@@ -298,7 +298,7 @@ public static function getInstance($prefix, $config = array())
}
else
{
- throw new Exception(JText::sprintf('JLIB_APPLICATION_ERROR_INVALID_CONTROLLER_CLASS', $class));
+ throw new InvalidArgumentException(JText::sprintf('JLIB_APPLICATION_ERROR_INVALID_CONTROLLER_CLASS', $class));
}
return self::$instance;
@@ -1042,7 +1042,7 @@ protected function fetchConfigurationData($file = '', $class = 'JConfig')
}
else
{
- throw new Exception('Configuration class does not exist.');
+ throw new RuntimeException('Configuration class does not exist.');
}
}
@@ -246,7 +246,7 @@ public function testFetchConfigurationData($file, $class, $expectsClass, $expect
{
if ($expectedException)
{
- $this->setExpectedException('Exception');
+ $this->setExpectedException('RuntimeException');
}
if (is_null($file) && is_null($class))
@@ -756,7 +756,7 @@ public function testFetchConfigurationData($file, $class, $expectsClass, $expect
{
if ($expectedException)
{
- $this->setExpectedException('Exception');
+ $this->setExpectedException('RuntimeException');
}
if (is_null($file) && is_null($class))
@@ -203,7 +203,7 @@ public function testGetInstance()
*
* @return void
*
- * @expectedException Exception
+ * @expectedException InvalidArgumentException
* @since 11.3
*/
public function testGetInstanceException()
@@ -240,9 +240,9 @@ public function testGetName()
/**
* Test JController::getTask().
- *
+ *
* @return void
- *
+ *
* @since 11.3
*/
public function testGetTask()
@@ -104,7 +104,7 @@ class JStringTest_DataSet
array('Pig', 'cow', 'the pig jumped', false, 'the cow jumped'),
array('Pig', 'cow', 'the pig jumped', true, 'the cow jumped'),
array('Pig', 'cow', 'the pig jumped over the cow', true, 'the cow jumped over the cow'),
- array(array('PIG', 'JUMPED'), array('cow', 'hopped'), true, 'the pig jumped over the pig', 'the cow hopped over the cow'),
+ array(array('PIG', 'JUMPED'), array('cow', 'hopped'), 'the pig jumped over the pig', true, 'the cow hopped over the cow'),
array('шил', 'биш', 'Би шил идэй чадна', true, 'Би биш идэй чадна'),
array('/', ':', '/test/slashes/', true, ':test:slashes:'),
);

0 comments on commit 8e73e52

Please sign in to comment.