<?php

define('_JEXEC', 1);
define('DS', DIRECTORY_SEPARATOR);

require_once realpath(dirname(__FILE__) . '/../../library/Designer.php');

Designer::addPath('Designer_Tests', dirname(__FILE__) . '/tests');

Designer::addPath('Designer_App', dirname(__FILE__) .  '/../');

$options = array('format' => 'XML', 'outputToFile' => true);



/* Begin include joomla context*/
define('JPATH_BASE', dirname(dirname(dirname(dirname(dirname(__FILE__))))) . DS . 'administrator');

require_once JPATH_BASE . DS . 'includes' . DS . 'defines.php';
require_once JPATH_BASE . DS . 'includes' . DS . 'framework.php';
require_once JPATH_BASE . DS . 'includes' . DS . 'helper.php';
require_once JPATH_BASE . DS . 'includes' . DS . 'toolbar.php';

$app = JFactory::getApplication('administrator');
$app->initialise(array('language' => $app->getUserState('application.lang', 'lang')));
/* End include joomla context*/

Designer::load('Designer_Tests_Tester');
Designer::load('Designer_Tests_PlaceHoldersStorageTest');
Designer::load('Designer_Tests_ProjectTest');
Designer::load('Designer_Tests_CacheTest');
Designer::load('Designer_Tests_HashTest');
Designer::load('Designer_Tests_ChunkTest');
Designer::load('Designer_Tests_ConfigTest');
Designer::load('Designer_Tests_ModulesUpdaterTest');

Designer_Tests_Tester::run(array(
    new Designer_Tests_PlaceHoldersStorageTest(),
    new Designer_Tests_ProjectTest(),
    new Designer_Tests_CacheTest(),
    new Designer_Tests_HashTest(),
    new Designer_Tests_ChunkTest(),
    new Designer_Tests_ConfigTest(),
    new Designer_Tests_ModulesUpdaterTest()
), $options);