/**
  * @test
  */
 public function getChartWithNumberOfValuesDifferents()
 {
     $mapsWithGroupedValues = $this->goupedListWithDifferentYears();
     $years = array(1989, 1992);
     $xml = str_replace('<?xml version="1.0"?>', '', $this->chartBuilder->build($mapsWithGroupedValues, $years));
     $this->assertEquals($this->xml2(), trim($xml));
 }
Exemplo n.º 2
0
 public function build()
 {
     if ($this->builder !== null) {
         $this->builder->build($this->days);
     } else {
         return false;
     }
 }
Exemplo n.º 3
0
function calcola_prenotazione_online($user)
{
    $builder = new Builder();
    $dispatcher = $builder->build('calcola-online', null, $user, $_REQUEST['rc_sito_parking']);
    $dispatcher->executeAjax($_REQUEST);
    $ar_errori = $dispatcher->get_errori();
    if (!empty($ar_errori)) {
        $ar_response['errori'] = $ar_errori;
        $ar_response['totale_giorni'] = 0;
        $ar_response['totale_costo'] = 0;
        return json_encode($ar_response);
    }
    $ar_so_selected = null;
    if ($_REQUEST['so']) {
        $ar_so_selected = json_decode($_REQUEST['so']);
    }
    $ar_data = array('sito_parking' => $_REQUEST['rc_sito_parking'], 'dt_p_iniziale' => $_REQUEST['rc_dt_checkin_checkout_in'], 'ora_p_iniziale' => $_REQUEST['rc_tm_checkin_checkout_in'], 'dt_p_finale' => $_REQUEST['rc_dt_checkin_checkout_out'], 'ora_p_finale' => $_REQUEST['rc_tm_checkin_checkout_out'], 'tipo_parcheggio' => $_REQUEST['rc_tipo_parcheggio'], 'tipo_cliente' => null, 'tipo_automezzo' => $_REQUEST['rc_tp_veicolo_cliente'], 'valore_sct_mag' => null, 'tipo_sct_mag' => null, 'p_online' => true, 'tp_sct_mag_v_p' => null, 'so' => $ar_so_selected, 'sop' => null);
    $calcoli = new CalcolaCostiStrategy();
    $calcoli->set_data($ar_data);
    $calcoli->calcola();
    $ar_response['totale_giorni'] = $calcoli->get_totale_giorni();
    $valore_sconto = floatval($calcoli->get_valore_sct_p_online());
    $ar_response['totale_costo'] = $calcoli->get_totale_costo() + $valore_sconto;
    if ($valore_sconto != 0) {
        $ar_response['totale_scontato'] = $ar_response['totale_costo'] - $valore_sconto;
        $ar_response['totale_risparmio'] = $ar_response['totale_costo'] - $ar_response['totale_scontato'];
    }
    return json_encode($ar_response);
}
Exemplo n.º 4
0
 /**
  * builds a collection of fixtures
  *
  * @param  array $rawData
  * @return array
  */
 protected function buildFixtures(array $rawData)
 {
     $fixtures = [];
     foreach ($rawData as $class => $specs) {
         $this->log('Loading ' . $class);
         foreach ($specs as $name => $spec) {
             $fixtures[] = $this->builder->build($class, $name, null !== $spec ? $spec : []);
         }
     }
     return $fixtures ? call_user_func_array('array_merge', $fixtures) : [];
 }
Exemplo n.º 5
0
 /**
  * builds a collection of fixtures
  *
  * @param  array      $rawData
  * @return Collection
  */
 protected function buildFixtures(array $rawData)
 {
     $fixtures = array();
     foreach ($rawData as $class => $specs) {
         $this->log('Loading ' . $class);
         foreach ($specs as $name => $spec) {
             $fixtures = array_merge($fixtures, $this->builder->build($class, $name, $spec));
         }
     }
     return $fixtures;
 }
Exemplo n.º 6
0
 /**
  * Get all Revision-Details
  *
  * @param  boolean $bCreateDiff [true]
  *
  * @return Aggregator
  */
 public function run($bCreateDiff = true)
 {
     foreach ($this->_aArguments['revisions'] as $sRevision) {
         $this->_aRevisions[] = $this->_oBuilder->build($this->_aArguments['config']->remote, $sRevision);
     }
     $aActions = array('read');
     if ($bCreateDiff === true) {
         $aActions[] = 'diff';
     }
     $oParallel = \parallely\Builder::build($this->_aRevisions, $this->_aArguments['config']->parallel);
     $this->_aRevisions = $oParallel->run($aActions)->get();
     unset($oParallel);
     return $this;
 }
function runBuilder($params)
{
    $builder = new Builder($params);
    if ($builder->build()) {
        $contents = array();
        $contents[] = '';
        $contents[] = '// add to AppDelegate.cpp';
        $contents[] = sprintf('#include "%s"', $builder->getOutputFilename() . '.h');
        $contents[] = '';
        $contents[] = '// add to AppDelegate::applicationDidFinishLaunching()';
        $contents[] = 'CCLuaStack* stack = CCScriptEngineManager::sharedManager()->getScriptEngine()->getLuaStack();';
        $contents[] = 'lua_State* L = stack->getLuaState();';
        $contents[] = sprintf('%s(L);', $builder->getLuaopenFunctionName());
        $contents[] = '';
        print implode("\n", $contents);
    }
}
Exemplo n.º 8
0
#ifdef __cplusplus
    void* tolua_obj = Mtolua_new((LUA_STRING)(tolua_ret));
     tolua_pushusertype(tolua_S,tolua_obj,"LUA_STRING");
    tolua_register_gc(tolua_S,lua_gettop(tolua_S));
#else
    void* tolua_obj = tolua_copy(tolua_S,(void*)&tolua_ret,sizeof(LUA_STRING));
     tolua_pushusertype(tolua_S,tolua_obj,"LUA_STRING");
    tolua_register_gc(tolua_S,lua_gettop(tolua_S));
#endif
   }
EOT;
$replace = '';
$FIX[$find] = $replace;
$find = 'LUA_STRING tolua_ret = (LUA_STRING)';
$replace = '';
$FIX[$find] = $replace;
$find = <<<EOT
static int tolua_collect_LUA_STRING (lua_State* tolua_S)
{
 LUA_STRING* self = (LUA_STRING*) tolua_tousertype(tolua_S,1,0);
    Mtolua_delete(self);
    return 0;
}
EOT;
$replace = '';
$FIX[$find] = $replace;
// main
printf("\nOUT_DIR: %s\n", OUT_DIR);
$builder = new Builder('Cocos2d', 'LuaCocos2d', $FIX);
$builder->build();
Exemplo n.º 9
0
 * @author    Sébastien Mischler (skarab) <*****@*****.**>
 * @link      https://github.com/lautr3k/Straw
 */
namespace Straw;

// Define root path (force unix style)
define('ROOT_PATH', str_replace('\\', '/', __DIR__));
// Define classes path
define('CLASSES_PATH', ROOT_PATH . '/classes');
// Auto loading classes
spl_autoload_register(function ($class_name) {
    require CLASSES_PATH . '/' . str_replace('\\', '/', $class_name) . '.php';
});
try {
    // Create the project builder instance
    $builder = new Builder('../src', '../dist');
    // Build and display the output
    $builder->build()->display();
} catch (\Exception $e) {
    $message = $e->getMessage();
    $file = $e->getFile();
    $line = $e->getLine();
    $output = "<html lang=\"en\"><head><meta charset=\"utf-8\">";
    $output .= "<title>Error !</title></head><body>";
    $output .= "<h1>Error !</h1><hr /><pre>";
    $output .= "<b>Message :</b> {$message}\n";
    $output .= "<b>File    :</b> {$file}\n";
    $output .= "<b>Line    :</b> {$line}\n";
    $output .= "</pre></body></html>";
    echo $output;
}
<?php

define("RC_PARKAUTO", 'rc_parkauto');
include_once RC_PARKAUTO . '/class/costi_strategy.php';
include_once RC_PARKAUTO . '/class/init_action.php';
include_once RC_PARKAUTO . '/class/parkauto_builder.php';
include_once RC_PARKAUTO . '/class/parkauto_registrazione.php';
include_once RC_PARKAUTO . '/class/generic_funcs.php';
include_once RC_PARKAUTO . '/class/dispatcher.php';
$sito = null;
if (isset($_REQUEST['rc_sito_parking'])) {
    $sito = $_REQUEST['rc_sito_parking'];
}
$action = null;
if (isset($_REQUEST['rc_action'])) {
    $action = $_REQUEST['rc_action'];
}
global $user;
$builder = new Builder();
$dispatcher = $builder->build($action, $nid = 0, $user, $sito);
$dispatcher->execute($_REQUEST);
Exemplo n.º 11
0
<?php

/**
 * This scripts builds the application
 */
include dirname(__FILE__) . '/inc.php/sourceXmlParser.php';
include dirname(__FILE__) . '/inc.php/config.php';
include dirname(__FILE__) . '/inc.php/builder.php';
$config = new Configuration();
if (!$config->checkLibraries()) {
    print "Build canceled, not all required libraries are installed.\n\n";
    return 1;
}
$parser = new SourceParser();
$parser->load();
$builder = new Builder($config, $parser);
$builder->build(dirname(__FILE__) . '/../src/', dirname(__FILE__) . '/build/obj/', dirname(__FILE__) . '/build/xournalpp', 'xournalpp');
Exemplo n.º 12
0
 /**
  * Test a failing build
  */
 public function testFailingBuild()
 {
     $this->setExpectedException('\\notifyy\\Exception', \notifyy\Exception::UNKNOWN_ADAPTER);
     Builder::build('test');
 }
Exemplo n.º 13
0
 /**
  * Test build error object
  *
  * @expectedException \StealThisShow\StealThisTracker\Bencode\Error\Build
  *
  * @return void
  */
 public function testBuildErrorObject()
 {
     Builder::build((object) array('attribute' => 'something'));
 }
Exemplo n.º 14
0
 public function viewDefault()
 {
     $_current = new Builder();
     return $_current->build();
 }