------------------------------------------------------------ revno: 996 committer: Jon Phillips <[email protected]> branch nick: public timestamp: Fri 2012-01-06 18:11:31 +0800 message: added back files removed from bassel in his fit of radicalism ;) The defs are necessary for the logviewer and the tests are for making unit tests, but it all needs to be stitched back in added: configs/defs.inc tests/ tests/Makefile.am tests/README tests/assets/ tests/bootstrap.php tests/libs/ tests/libs/LogTest.php tests/phpunit.xml
-- lp:aikiframework https://code.launchpad.net/~aikiframework-devel/aikiframework/trunk Your team Aiki Framework Developers is subscribed to branch lp:aikiframework. To unsubscribe from this branch go to https://code.launchpad.net/~aikiframework-devel/aikiframework/trunk/+edit-subscription
=== added file 'configs/defs.inc' --- configs/defs.inc 1970-01-01 00:00:00 +0000 +++ configs/defs.inc 2012-01-06 10:11:31 +0000 @@ -0,0 +1,123 @@ +<?php + +/** Aiki Framework (PHP) + * + * Some of the values for the define statements in this file are generated + * automatically when the autoconf configure script is executed. + * These are meant to be used as the default configuration. Please, + * be aware that the configuration is expected change during run-time. + * This resulting file name will be defs.php and is meant for ALL + * types of the distribution packages. This file should only contain + * constants that can be reasonably shared between all distributions. + * This means that during configuration of a distribution, the values + * can be set to generally support all the targeted platforms + * as well as a specific platform. + * + * LICENSE + * + * This source file is subject to the AGPL-3.0 license that is bundled + * with this package in the file LICENSE. + * + * @author Aikilab http://www.aikilab.com + * @copyright (c) 2008-2011 Aiki Lab Pte Ltd + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html + * @link @PACKAGE_URL@ + * @category Aiki + * @package Configs + * @version @VERSION@.@REVISION@ + * @filesource */ + + +// @TODO added these back from aiki-defs.inc and need to be defined in installer +/** Aiki Site URL */ +define("AIKI_SITE_URL", "@AIKI_SITE_URL@"); + +/** Aiki Rewrite Base (for htaccess) */ +define("AIKI_REWRITE_BASE", "@AIKI_REWRITE_BASE@"); + + +/** Aiki Framework Revision */ +define("AIKI_REVISION", "@REVISION@"); + +/** Aiki Authors */ +define("AIKI_AUTHORS", '@AUTHORS@'); + +/** Aiki Log Directory */ +define("AIKI_LOG_DIR", "@AIKI_LOG_DIR@"); + +/** Aiki Log File Name */ +define("AIKI_LOG_FILE", "@AIKI_LOG_FILE@"); + +/** Aiki Host Profile File Name */ +define("AIKI_LOG_PROFILE", "@AIKI_LOG_PROFILE@"); + +/** Aiki Log Level */ +define("AIKI_LOG_LEVEL", "@AIKI_LOG_LEVEL@"); + +/** Aiki directory that stores downloads and + * backup files used to revert from update */ +define("AIKI_SAVE_DIR", "@AIKI_SAVE_DIR@"); + +/** Aiki directory that stores downloads. + * This must be relative to the aiki save directory */ +define("AIKI_DOWNLOAD_DIR", "@AIKI_DOWNLOAD_DIR@"); + +/** Aiki directory that stores backups. + * This must be relative to the aiki save directory */ +define("AIKI_BACKUP_DIR", "@AIKI_BACKUP_DIR@"); + +/** Aiki directory that stores updates. + * This must be relative to the aiki save directory */ +define("AIKI_UPDATE_DIR", "@AIKI_UPDATE_DIR@"); + +/** Whether suPHP is turned on or off. Default is off. + * When --enable-update is given, then it is on. */ +define("SUPHP_ENGINE", "@SUPHP_ENGINE@"); + +/** Aiki Random string should be different everytime + * a distribution package is configured and built */ +define("AIKI_RANDOM", "@AIKI_RANDOM@"); + +// **** Begin non-generated constants **** // + +/** Aiki Update URL with update information and requirements */ +define("AIKI_UPDATE_URL", "http://aikiframework.org/files/update"); + +/** Whether or not to check for update after admin login */ +define("AIKI_UPDATE_CHECK", true); + +/** Aiki Update URL to the update package excluding filename */ +define("AIKI_UPDATE_PATH", "http://aikiframework.org/files/"); + +/** First part of the update package filename excluding version and extension */ +define("AIKI_UPDATE_PREFIX", "aiki-src-"); + +/** Last part of the update package filename indicating file format */ +define("AIKI_UPDATE_EXT", ".zip"); + +/** Last part of the sum filename indicating file format */ +define("AIKI_SUM_EXT", ".shasum-256.txt"); + +/** Retry to download or validate the downloaded update package + * this number of times if failed. Do NOT put the following value in quotes. */ +define("AIKI_UPDATE_RETRY", 3); + +/** Whether or not this update involves changes to the Aiki + * configuration (aiki_config table, config.php or .htaccess) + * Do NOT put the following value (TRUE or FALSE) in quotes. */ +define("AIKI_UPDATE_CONFIG", false); + +/* the following error related constants + * are built-in on newer versions of PHP */ +if (!defined("E_RECOVERABLE_ERROR")) { + /** Define E_RECOVERABLE_ERROR if not defined */ + define("E_RECOVERABLE_ERROR", 4096); +} +if (!defined("E_DEPRECATED")) { + /** Define E_DEPRECATED if not defined */ + define("E_DEPRECATED", 8192); +} +if (!defined("E_USER_DEPRECATED")) { + /** Define E_USER_DEPRECATED if not defined */ + define("E_USER_DEPRECATED", 16384); +} === added directory 'tests' === added file 'tests/Makefile.am' --- tests/Makefile.am 1970-01-01 00:00:00 +0000 +++ tests/Makefile.am 2012-01-06 10:11:31 +0000 @@ -0,0 +1,44 @@ +# Process this file with automake to produce Makefile.in -*-Makefile-*- + +# Copyright (c) 2010-2011 Aiki Lab Pte Ltd + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. + +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# Written by Steven Garcia + +# The source files +aiki_test_files = \ + bootstrap.php \ + phpunit.xml + +# Subdirectories to be built +SUBDIRS = + +# Subdirectories to distribute +DIST_SUBDIRS = + +# Additional files to distribute +EXTRA_DIST = \ + $(aiki_test_files) \ + assets \ + libs + +# Additional things to do on dist +dist-hook : + +if ENABLE_TESTS +# Things to do on check +check : + $(CD) $(abs_top_srcdir)/tests && $(PHPUNIT) --verbose +endif === added file 'tests/README' --- tests/README 1970-01-01 00:00:00 +0000 +++ tests/README 2012-01-06 10:11:31 +0000 @@ -0,0 +1,2 @@ +This is the salvaged phpunit tester which is not directly hooked into aiki +framework. === added directory 'tests/assets' === added file 'tests/bootstrap.php' --- tests/bootstrap.php 1970-01-01 00:00:00 +0000 +++ tests/bootstrap.php 2012-01-06 10:11:31 +0000 @@ -0,0 +1,10 @@ +<?php + +/** Prepend to the include path for all unit tests. + * Tests should always prefer the configured and built + * src before the distributed source. */ +set_include_path( + __DIR__ . "/../build/src" . PATH_SEPARATOR . + __DIR__ . "/../src" . PATH_SEPARATOR . + get_include_path() +); \ No newline at end of file === added directory 'tests/libs' === added file 'tests/libs/LogTest.php' --- tests/libs/LogTest.php 1970-01-01 00:00:00 +0000 +++ tests/libs/LogTest.php 2012-01-06 10:11:31 +0000 @@ -0,0 +1,47 @@ +<?php + +/** Aiki Framework Tests (PHP) + * + * Tests the Log utility. + * + * LICENSE + * + * This source file is subject to the AGPL-3.0 license that is bundled + * with this package in the file LICENSE. + * + * @author Aikilab http://www.aikilab.com + * @copyright (c) 2008-2011 Aiki Lab Pte Ltd + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html + * @link http://www.aikiframework.org + * @category Aiki + * @package Tests + * @filesource */ + +/** define this for script access */ +define("IN_AIKI", TRUE); + +require_once("libs/Log.php"); + +/** To test protected properties and methods */ +class TestLog extends Log { + public function getAllow() { + return $this->_allow; + } +} + +/** This is the test class which should be the same as the file name */ +class LogTest extends PHPUnit_Framework_TestCase { + + public function testGetContents() { + + // test the get contents method + $log = new TestLog("", "", "", ""); + $this->assertSame("NONE", $log->getContents()); + + $log = new TestLog(".", "test.log", "none", "."); + $this->assertSame("NONE", $log->getContents()); + + // test protected property value + $this->assertSame("NONE", $log->getAllow()); + } +} \ No newline at end of file === added file 'tests/phpunit.xml' --- tests/phpunit.xml 1970-01-01 00:00:00 +0000 +++ tests/phpunit.xml 2012-01-06 10:11:31 +0000 @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<phpunit backupGlobals="false" + backupStaticAttributes="false" + colors="false" + convertErrorsToExceptions="false" + convertNoticesToExceptions="false" + convertWarningsToExceptions="false" + processIsolation="false" + stopOnFailure="false" + syntaxCheck="false" + bootstrap="bootstrap.php" + verbose="true"> + <testsuites> + <testsuite name="Aiki Test Suite"> + <file>libs/LogTest.php</file> + </testsuite> + </testsuites> +</phpunit>
_______________________________________________ Mailing list: https://launchpad.net/~aikiframework-devel Post to : [email protected] Unsubscribe : https://launchpad.net/~aikiframework-devel More help : https://help.launchpad.net/ListHelp

