public function test_getLocalDir() { //Get directory $dir = Engine::getLocalDir(); //Test that the directory exists $this->assertEquals(true, file_exists($dir)); //get the path to where we think the engine SHOULD exist $getPath = realpath(__DIR__ . "/../engine/"); //Check whether the engine exists to where we think it is. $this->assertEquals(true, $dir == $getPath); }
<?php require Engine::getLocalDir() . "/structure/ReflectiveObject.php"; class User extends ReflectiveObject { public $id, $name, $email; const YEARS_TO_GO_BACK = 2; const MOST_POST_AVG_PER_DAY = 10; public static function instance() { static $instance; if (is_null($instance)) { $instance = new User(); } return $instance; } public function __construct() { $this->isLoggedIn = $this->authenticate(); } public function getToken() { return isset($_SESSION['facebook_sdk_access_token']) ? $_SESSION['facebook_sdk_access_token'] : null; } public function setToken($value) { $_SESSION['facebook_sdk_access_token'] = $value; } private $isLoggedIn; private function authenticate() {