Ejemplo n.º 1
0
<?php

phpBurn::load('Tools.Util.Router');
phpBurn::load('Controller');
/** My Fake controller just for tests */
class tools extends Controller
{
    public $calledAction;
    public $actionParams;
    public $errorNum;
    // dummy function so we dont need to include files
    public function controllerExists()
    {
        return true;
    }
    public function callAction($action, $params)
    {
        $this->calledAction = $action;
        $this->actionParams = $params;
    }
    public function util()
    {
    }
}
class Tools_Util_Router_Test extends PHPUnit_Framework_TestCase
{
    public $scriptName;
    public $requestURI;
    public function setUp()
    {
        parent::setUp();
Ejemplo n.º 2
0
<?php

phpBurn::load('Configuration');
/**
 * Testing Configuration
 **/
class Configuration_Test extends PHPUnit_Framework_TestCase
{
    public function testIfRequiredOptionsThrowsExceptions()
    {
        $this->markTestSkipped();
        phpBURN_Message::setMode(phpBURN_Message::CONSOLE);
        // database required
        ob_start();
        try {
            $Configuration = new phpBURN_Configuration(array('packages' => array('app')));
            $this->assertTrue(false, 'Should never hit this line');
        } catch (Exception $e) {
            $msg = ob_get_contents();
            $this->assertRegExp('/Exception/', $msg);
        }
        // user required
        try {
            $Configuration = new phpBURN_Configuration(array('database' => 'somedb', 'packages' => array('app')));
            $this->assertTrue(false, 'Should never hit this line');
        } catch (Exception $e) {
        }
        $msg = ob_get_contents();
        $this->assertRegExp('/Exception/', $msg);
        // password required
        try {