Exemplo n.º 1
0
 public function testModelShort()
 {
     $_REQUEST['__url'] = 'home';
     $this->ob();
     $test = new Test();
     $this->assertTrue($test->test());
 }
Exemplo n.º 2
0
 public function index()
 {
     /*-------------------------------------
     		= 我的资料
     		-------------------------------------*/
     $my_info = $this->api->user_getInfo($this->mid);
     $this->assign('my_info', $my_info);
     /*-------------------------------------
     		= 好友列表
     		-------------------------------------*/
     $my_fris = $this->api->friend_get();
     $fris_info = $this->api->user_getInfo($my_fris);
     $this->assign('fris_info', $fris_info);
     /*-------------------------------------
     		= 通知
     		-------------------------------------*/
     $notify_num = $this->api->notify_getNewNum();
     //通知个数
     $notifys = $this->api->notify_get("notification");
     //通知内容
     $this->assign('notify_num', $notify_num);
     $this->assign('notify_con', $notifys);
     /*-------------------------------------
     		= 好友动态
     		-------------------------------------*/
     $my_feeds = $this->api->feed_get("fri", "all", 10);
     $fri_feeds = $this->api->feed_get("my", "all", 3);
     $this->assign('my_feeds', $my_feeds);
     $this->assign('fri_feeds', $fri_feeds);
     /*-------------------------------------
     		= 公共类库
     		-------------------------------------*/
     vendor("Test");
     $vendor_test = new Test();
     $vendor = $vendor_test->test();
     $this->assign('vendor', $vendor);
     $this->display();
 }
Exemplo n.º 3
0
<?php

include "../libs/Test.php";
$test = new Test(true ? COMPLETE : true, "Test Cache class");
$test->test(10, 2 + 8, "sum");
$test->test(20, 12 + 8, "sum");
$test->test(20, 12 + 8);
$test->test(11, 2 + 8, "no sum");
$test->render();
echo "<p class='well'>This test will fail..to  show how works when fails.</p>";
Exemplo n.º 4
0
{
    foreach ($resultsArray as $results) {
        file_put_contents($file, implode("\t", $results) . PHP_EOL, FILE_APPEND);
    }
}
$testMin = 1;
$testMax = 100000;
$tests = 50;
$print = true;
$verbose = false;
$filename = __DIR__ . '/data/minhash/results.' . date('Y-m-d_h-i-s') . '.csv';
file_put_contents($filename, '');
for ($i = $testMin; $i <= $testMax; $i += $block) {
    $block = pow(10, max(0, floor(log10($i))));
    $test = new Test($i);
    $test->test($tests);
    if ($print) {
        if ($verbose) {
            testHeader('Tested: ' . $i);
            printResults($test->results());
        }
        testHeader('Average: ' . $i);
        printResults(array($test->averages()));
    }
    fileResults($filename, $test->results());
    echo "Tested {$i}\r";
}
echo PHP_EOL;
class Test
{
    private $i;
Exemplo n.º 5
0
        }
        function getPeriodToSleep($obj)
        {
            return int;
        }
        function getPeriodBright($obj)
        {
            return int;
        }
        function getUsesPerCycle($obj)
        {
            return int;
        }
        function getUsePerAction($obj, $action)
        {
            return int;
        }
        function getRange($obj, $action)
        {
            return int;
        }
        function getConfortZone($obj)
        {
            return array();
        }
        require_once '../model/customWolf.php';
    }
}
$test = new Test();
$test->test();
Exemplo n.º 6
0
<?php

include "../libs/Test.php";
include "../libs/functions.php";
$test = new Test(defined("COMPLETE") ? COMPLETE : true, "Test Config class");
// providers..
$a = array("def-1" => true, "def-2" => false);
$b = array("def-2" => true, "def-3" => "999");
$good = array("def-1" => true, "def-2" => true);
// tests
$test->test($good, array_default_options($a, $b), "array_default_option");
$test->render();
Exemplo n.º 7
0
<?php

include "../libs/Test.php";
include "../libs/Config.php";
// providers..
$test = new Test(defined("COMPLETE") ? COMPLETE : true, "Test Config class");
$config = new Config(array("test-1" => 1, "test-2" => false));
// test
$test->test(1, $config->get("test-1"), "get");
$test->test(false, $config->get("test-2"), "get");
$test->test(NULL, $config->get("test-3"), "get null");
$test->render();
Exemplo n.º 8
0
<?php

include "../libs/Test.php";
// providers
include "../libs/Config.php";
$config = new Config(array("start" => microtime(), "debug" => true, "caches" => array("html" => array("dir" => "tmp", "timeout" => 500))));
include "../libs/Cache.php";
//@TODO phpUNIT
$dir = dirname(__FILE__) . "/tmp";
if (!is_dir($dir)) {
    mkdir(dirname(__FILE__) . "/tmp");
}
$cache = new Cache($config);
$test = new Test(defined("COMPLETE") ? COMPLETE : true, "Test Cache class");
$test->test(true, $cache->is_cacheable("html"), "cacheable html");
$test->test(false, $cache->is_cacheable("png"), "cacheable png");
$test->render();
Exemplo n.º 9
0
<?php

namespace Hasantayyar\Osbib;

include __DIR__ . '/vendor/autoload.php';
Test::test();