test again

This commit is contained in:
Shoghi Cervantes 2013-08-28 17:02:04 +02:00
parent 5d27a40a6e
commit feea39a97f
2 changed files with 32 additions and 35 deletions

View File

@ -26,7 +26,9 @@ class PocketMinecraftServer{
private function load(){
$this->version = new VersionString();
if(!defined("DEBUG") or DEBUG >= 0){
@cli_set_process_title("PocketMine-MP ".MAJOR_VERSION);
}
if($this->version->isDev()){
console("[INFO] \x1b[31;1mThis is a Development version");
}
@ -87,7 +89,7 @@ class PocketMinecraftServer{
public function titleTick(){
$time = microtime(true);
if(ENABLE_ANSI === true){
if((!defined("DEBUG") or DEBUG >= 0) and ENABLE_ANSI === true){
echo "\x1b]0;PocketMine-MP ".MAJOR_VERSION." | Online ". count($this->clients)."/".$this->maxClients." | RAM ".round((memory_get_usage() / 1024) / 1024, 2)."MB | U ".round(($this->interface->bandwidth[1] / max(1, $time - $this->interface->bandwidth[2])) / 1024, 2)." D ".round(($this->interface->bandwidth[0] / max(1, $time - $this->interface->bandwidth[2])) / 1024, 2)." kB/s | TPS ".$this->getTPS()."\x07";
}
$this->interface->bandwidth = array(0, 0, $time);

View File

@ -1,21 +1,9 @@
<?php
/***REM_START***/
if(class_exists("PocketMinecraftServer", false)){
return;
}
if(!class_exists("PocketMinecraftServer", false)){
class ServerSuiteTest extends PHPUnit_Framework_TestCase{
private $server;
public function hook(){
$this->assertTrue(true);
$server = ServerAPI::request();
//Everything done!
$server->close();
}
public function testRead(){
public function testStart(){
define("NO_THREADS", true);
define("DEBUG", -1); //No output
require_once(dirname(__FILE__)."/../dependencies.php");
@ -30,11 +18,18 @@
$this->assertTrue(Utils::readLong("\x41\x02\x03\x04\x05\x06\x07\x08") === "4684309878217770760", "Utils::readLong");
//PocketMine-MP server startup
$this->server = new ServerAPI();
$this->server->load();
$this->assertTrue(is_integer($this->server->event("server.start", array($this, "hook"))));
$this->server->init();
exit(0);
$server = new ServerAPI();
$server->load();
$this->assertTrue(is_integer($server->event("server.start", array($this, "hook"))));
$server->init();
}
public function hook(){
$this->server = ServerAPI::request();
//Everything done!
$this->server->close();
}
}
}
/***REM_END***/