Source for file MissingParameterTest.php
Documentation is available at MissingParameterTest.php
* "THE BEER-WARE LICENSE" (Revision 42):
* "Sven Strittmatter" <ausserirdisch@sven-space.de> wrote this file.
* As long as you retain this notice you can do whatever you want with
* this stuff. If we meet some day, and you think this stuff is worth it,
* you can buy me a beer in return.
* @copyright Copyright (c) 2009 Sven Strittmatter
// Call Console_ApplicationTest::main() if this source file is executed directly.
if (!defined('PHPUnit_MAIN_METHOD')) {
define('PHPUnit_MAIN_METHOD', 'Console_Exception_MissingParameterTest::main');
require_once(dirname(__FILE__ ) . '/../../TestHelper.php');
* Console_Application_Abstract
require_once('Console/Exception/MissingParameter.php');
* @subpackage Console_Exception
* @copyright Copyright (c) 2009 Sven Strittmatter
* Runs the test methods of this class.
public static function main() {
require_once('PHPUnit/TextUI/TestRunner.php');
$suite = new PHPUnit_Framework_TestSuite("Console_Exception_MissingParameterTest");
$result = PHPUnit_TextUI_TestRunner::run($suite);
* We expect a string like:
* You omitted the required parameter PARAMETER.
$parmeters = array('a', 'b', 'f', '-blub', 'LaLa');
foreach ($parmeters as $parameter) {
$expectedString = "You omitted the required parameter $parameter.";
$this->assertEquals($expectedString, $exception->__toString());
$this->assertEquals($expectedString, $exception . '');
// Call Console_ApplicationTest::main() if this source file is executed directly.
|