Skip to content

Commit

Permalink
folder reorinization
Browse files Browse the repository at this point in the history
  • Loading branch information
Evan Tahler committed Apr 16, 2011
1 parent cf7314b commit 7f43989
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 18 deletions.
6 changes: 3 additions & 3 deletions .gitignore
Expand Up @@ -2,6 +2,6 @@ favicon.gif
favicon.ico
API/CONFIG.php
API/DB/TABLES.php
API/LOG/*
SPEC/LOG/*
SERVER/LOG/*
API/log/*
SPEC/log/*
SERVER/log/*
10 changes: 5 additions & 5 deletions API/CONFIG.php.example
Expand Up @@ -50,7 +50,8 @@ $CONFIG['LOG_DB'] = $CONFIG['DB'];
$CONFIG['LOG_dbhost'] = $CONFIG['dbhost'];
$CONFIG['LOG_dbuser'] = $CONFIG['dbuser'];
$CONFIG['LOG_dbpass'] = $CONFIG['dbpass'];
$CONFIG['MySQLLogFile'] = "LOG/SQL.txt"; // comment me out not to log

$CONFIG['MySQLLogFile'] = "log/SQL.txt"; // comment me out not to log

/*********************************************************/
// Files and Folders
Expand All @@ -61,13 +62,13 @@ $CONFIG['App_dir'] = "/var/www/html/API/"; // the location of this application
// Tests and Specs
$CONFIG['ServerAddressForTests'] = "127.0.0.1:3000"; //port 3000 is the default for SERVER
$CONFIG['TestRootFolder'] = $CONFIG['App_dir']."../SPEC/";
$CONFIG['TestLog'] = $CONFIG['App_dir']."../SPEC/LOG/test_log.txt";
@mkdir("../SPEC/LOG/");
$CONFIG['TestLog'] = $CONFIG['App_dir']."../SPEC/log/test_log.txt";
@mkdir("../SPEC/log/");

/*********************************************************/
// CRON
@mkdir("LOG");
$CONFIG['CronLogFile'] = "LOG/CRON_LOG.txt";
$CONFIG['CronLogFile'] = "log/CRON_LOG.txt";
$CONFIG['MaxLogFileSize'] = 1048576 * 1; // 1MB

$CONFIG['LogsToCheck'] = array(); // log files that might get big that you want to automatically truncate
Expand All @@ -94,7 +95,6 @@ $CONFIG['NoLogAPIKeys'][] = "A_Blocked_APIKey";
// There can be seperate DBs in use for logging. The LogTable table is expected to be within this database.
$CONFIG['LogTable'] = "LOG";
$CONFIG['LOG_DB'] = $CONFIG['DB']; // There can be a seperate DB in use for logging. The LogTable table is expected to be within this database.
$CONFIG['MySQLLogFile'] = "LOG/SQL.txt"; // comment me out not to log

/*********************************************************/
// Sessions
Expand Down
4 changes: 2 additions & 2 deletions SERVER/server_config.php
Expand Up @@ -16,10 +16,10 @@
$SERVER['root_path'] = "../API/"; // from location of SERVER.php
$SERVER['PHP_Path'] = "/usr/bin/php";
$SERVER['systemTimeZone'] = "America/Los_Angeles";
$SERVER['log_file'] = "LOG/SERVER_LOG.txt";
$SERVER['log_file'] = "log/SERVER_LOG.txt";
$SERVER['timeout'] = 10; //how long to wait (seconds) before returning to the client with a 500 error

@mkdir("LOG");
@mkdir("log");

function parseArgs(){
global $argv;
Expand Down
22 changes: 14 additions & 8 deletions SPEC/flows/users_spec.php → SPEC/end_to_end/users_spec.php
Expand Up @@ -7,7 +7,13 @@
I check a combination of API actions
***********************************************/
require_once("../spec_helper.php");
$T = new DaveTest("Cache Test");
$T = new DaveTest("End to End Test: Users");

// set some random values to ensure that this user doesn't exist already
$TestValues = array(
"ScreenName" => rand().time()."_name",
"EMail" => rand().time()."@test.com"
);

$T->context("I should be able to create a user");
$PostArray = array(
Expand All @@ -17,8 +23,8 @@
"Password" => "password",
"FirstName" => "DEMO",
"LastName" => "TESTMAN",
"ScreenName" => "DemoTestMan",
"EMail" => "fake@fake.com"
"ScreenName" => $TestValues['ScreenName'],
"EMail" => $TestValues['EMail']
);

$APIRequest = new APIRequest($TestURL, $PostArray);
Expand All @@ -33,14 +39,14 @@
"OutputType" => "PHP",
"Action" => "UserView",
"LimitLockPass" => $CONFIG['CorrectLimitLockPass'],
"ScreenName" => "DemoTestMan",
"ScreenName" => $TestValues['ScreenName'],
);

$APIRequest = new APIRequest($TestURL, $PostArray);
$APIDATA = $APIRequest->DoRequest();
$T->assert("==",$APIDATA["ERROR"],"OK");
$T->assert("==",$APIDATA["User"]["InformationType"],"Public");
$T->assert("==",$APIDATA["User"]["ScreenName"],"DemoTestMan");
$T->assert("==",$APIDATA["User"]["ScreenName"],$TestValues['ScreenName']);
$T->assert("==",count($APIDATA["User"]),3);

$T->context("I should be able to View a user privately");
Expand All @@ -56,10 +62,10 @@
$APIDATA = $APIRequest->DoRequest();
$T->assert("==",$APIDATA["ERROR"],"OK");
$T->assert("==",$APIDATA["User"]["InformationType"],"Private");
$T->assert("==",$APIDATA["User"]["ScreenName"],"DemoTestMan");
$T->assert("==",$APIDATA["User"]["ScreenName"],$TestValues['ScreenName']);
$T->assert("==",$APIDATA["User"]["FirstName"],"DEMO");
$T->assert("==",$APIDATA["User"]["LastName"],"TESTMAN");
$T->assert("==",$APIDATA["User"]["EMail"],"fake@fake.com");
$T->assert("==",$APIDATA["User"]["EMail"],$TestValues['EMail']);
$T->assert("==",count($APIDATA["User"]),12);

$T->context("I should be able to Log In");
Expand Down Expand Up @@ -112,7 +118,7 @@
"OutputType" => "PHP",
"Action" => "UserView",
"LimitLockPass" => $CONFIG['CorrectLimitLockPass'],
"ScreenName" => "DemoTestMan",
"ScreenName" => $TestValues['ScreenName'],
);

$APIRequest = new APIRequest($TestURL, $PostArray);
Expand Down

0 comments on commit 7f43989

Please sign in to comment.