function after() { $this->endTime = microtime(true); $this->runTime = $this->endTime - $this->startTime; $elapsed = number_format($this->runTime * 1000, 1); $passed = $failed = $total = 0; foreach (runner()->specs as $spec) { $total++; if ($spec->failed()) { $count = count($spec->failures); $failed += $count; $passed += $spec->assertions - $count; } else { $passed += $spec->assertions; } } if ($failed) { echo "\n\n" . $this->color(' ✖ ' . $failed . ' of ' . $total . ' failed: ', 'red') . "\n\n"; } else { echo "\n\n" . $this->color(' ✓ ' . $total . ' test' . ($total === 1 ? '' : 's') . ' complete', 'green') . $this->color(" ({$elapsed} ms)\n\n", 'white'); } $failedNum = 0; foreach (runner()->specs as $spec) { if ($spec->failed()) { foreach ($spec->failures as $failure) { $failedNum++; $description = $spec->parent->description . ' ' . $spec->description; echo ' ' . $failedNum . ') ' . $description . ":\n"; echo $this->color(' ' . $failure->getMessage() . "\n", 'red'); echo $this->color($this->indent($failure->getTraceAsString(), 4) . "\n\n", 'white'); } } } $this->banner($this->passed, $this->failed); }
$qs = $_SERVER['QUERY_STRING']; $config = ['appserver' => 'ionic']; $factory = array(); $library = array('mixing' => '', 'orm' => $link); ////// SimpleCore include 'config/_bootstrap.php'; ////// Security Actions $onlypost = array('save', 'get'); ////// Actions Zone function hello() { global $factory; echo factory(null, 'mixing')->getHtml('html/index.html'); } function trucks($json = false) { if ($json == 'json') { echo json_encode(factory(null, 'orm')->query("SELECT * FROM trucks")); } else { echo factory(null, 'orm')->toTable("SELECT * FROM trucks"); } } function save($data = array()) { global $factory; echo 'Saving Data ' . $data['ipclient']; factory(null, 'orm')->insert(array('tabla' => 'look_track', 'reg' => array('ip' => $data['ipclient'], 'hostname' => $data['hostname']))); } ////// Simple Execute API runner();
function after() { $passed = $failed = 0; foreach (runner()->specs as $spec) { if ($spec->failed()) { $count = count($spec->failures); $failed += $count; $passed += $spec->assertions - $count; foreach ($spec->failures as $failure) { echo "\nFAILURE:\n"; echo $failure->getMessage() . "\n"; echo $failure->getTraceAsString() . "\n"; } } else { $passed += $spec->assertions; } } $this->endTime = microtime(true); $this->runTime = $this->endTime - $this->startTime; $this->banner($passed, $failed); }
function after() { $passed = $failed = 0; foreach (runner()->specs as $spec) { if ($spec->failed()) { $count = count($spec->failures); $failed += $count; $passed += $spec->assertions - $count; foreach ($spec->failures as $failure) { echo "\nFAILURE:\n"; echo $failure->getMessage() . "\n"; echo $failure->getTraceAsString() . "\n"; } } else { $passed += $spec->assertions; } } $this->endTime = microtime(true); $this->runTime = $this->endTime - $this->startTime; echo "\nFinished in " . number_format($this->runTime, 4) . " seconds\n\n"; echo $this->color('Passed: ', 'bold'); echo $this->color($passed, 'green'); echo $this->color(' Failed: ', 'bold'); echo $this->color($failed, 'red'); echo "\n\n"; }