tests/build/documentation/DocumentationTests.php -text
tests/build/packages/AllTests.php -text
tests/build/packages/BuildTests.php -text
+tests/code/deprecations/AllTests.php -text
+tests/code/deprecations/DeprecationsTests.php -text
tests/code/syntax/AllTests.php -text
tests/code/syntax/SyntaxTests.php -text
tests/func/AllTests.php -text
the amount of data involved, it might make sense to either cut and
paste by hand or dump the tables and reload them in the new schema.
+On the internal side of things, access to the database has been
+converted from the db_query() abstraction layer to the
+db_query_params() one. This means SQL queries are no longer built as
+strings with unwieldy and fragile escaping code, while ensuring no
+data coming from the user can be used for SQL injection attacks. The
+db_query() function, while deprecated, is still present for the
+benefit of out-of-tree code that might use it. It might be removed at
+some point in the future, so maintainers of local plugins or
+enhancements are encouraged to migrate their code to
+db_query_params(). For really complex queries that need to be built
+dynamically, there's also a db_query_qpa() abstraction, with a
+db_construct_qpa() method to manipulate "QPA" (query+params array)
+objects.
+
Release notes for FusionForge 4.8
---------------------------------
// Code tests
require_once 'code/syntax/AllTests.php';
+require_once 'code/deprecations/AllTests.php';
// Build tests
require_once 'build/packages/AllTests.php';
// Code tests
$suite->addTest(Syntax_AllTests::suite());
+ $suite->addTest(Deprecations_AllTests::suite());
// Building packages and documentation tests
$suite->addTest(Packages_AllTests::suite());
// Code tests
require_once 'code/syntax/AllTests.php';
+require_once 'code/deprecations/AllTests.php';
// Selenium based tests
//require_once 'func/Site/AllTests.php';
// Code tests
$suite->addTest(Syntax_AllTests::suite());
+ $suite->addTest(Deprecations_AllTests::suite());
// Integration tests (Selenium).
// $suite->addTest(Site_AllTests::suite());
--- /dev/null
+<?php
+require_once 'PHPUnit/Framework.php';
+
+require_once dirname(__FILE__).'/DeprecationsTests.php';
+
+class Deprecations_AllTests
+{
+ public static function suite()
+ {
+ $suite = new PHPUnit_Framework_TestSuite('PHPUnit Framework');
+
+ $suite->addTestSuite('Deprecations_Tests');
+ // ...
+
+ return $suite;
+ }
+}
+?>
--- /dev/null
+<?php
+
+require_once 'PHPUnit/Framework/TestCase.php';
+
+/**
+ * Syntax test class.
+ *
+ * @package DeprecationsTests
+ * @author Roland Mas <lolando@debian.org>
+ * @copyright 2009 Roland Mas
+ * @license http://www.opensource.org/licenses/gpl-license.php GPL License
+ */
+class Deprecations_Tests extends PHPUnit_Framework_TestCase
+{
+ /**
+ * Check that no code uses db_query()
+ */
+ public function testdb_query()
+ {
+ $output = `cd .. ; find gforge tests -name '*.php' -type f | xargs pcregrep -l '\bdb_query\b' \
+ | grep -v ^tests/code/deprecations/DeprecationsTests.php \
+ | grep -v ^gforge/db/upgrade-db.php \
+ | grep -v ^gforge/www/include/database-oci8.php \
+ | grep -v ^gforge/common/include/database-pgsql.php \
+ | grep -v ^gforge/common/include/database-mysql.php`;
+ $this->assertEquals('', $output);
+ }
+
+// Local Variables:
+// mode: php
+// c-file-style: "bsd"
+// End:
+
+}