diff options
author | Andreas Fischer <bantu@phpbb.com> | 2011-06-02 23:32:12 +0200 |
---|---|---|
committer | Andreas Fischer <bantu@phpbb.com> | 2011-06-02 23:32:12 +0200 |
commit | 672c333aced13afdaead43e84bb686f60b371f94 (patch) | |
tree | f1530eb280f2b4fb3795d56804a4fa1ec1b83881 /tests | |
parent | ed95c7195f52b49a611a1e91c43e6ac815a4d005 (diff) | |
parent | b1a4de3166f3f75fe707292f911076db53a0538d (diff) | |
download | forums-672c333aced13afdaead43e84bb686f60b371f94.tar forums-672c333aced13afdaead43e84bb686f60b371f94.tar.gz forums-672c333aced13afdaead43e84bb686f60b371f94.tar.bz2 forums-672c333aced13afdaead43e84bb686f60b371f94.tar.xz forums-672c333aced13afdaead43e84bb686f60b371f94.zip |
Merge branch 'develop-olympus' into develop
* develop-olympus:
[ticket/9685] Test for databases that are able to nest transactions
[ticket/9685] Consistently name the new sql_buffer_nested_transactions function
Diffstat (limited to 'tests')
-rw-r--r-- | tests/dbal/select_test.php | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/dbal/select_test.php b/tests/dbal/select_test.php index 533416f14b..e0d08d9306 100644 --- a/tests/dbal/select_test.php +++ b/tests/dbal/select_test.php @@ -8,6 +8,7 @@ */ require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php'; +require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php'; class phpbb_dbal_select_test extends phpbb_database_test_case { @@ -317,4 +318,27 @@ class phpbb_dbal_select_test extends phpbb_database_test_case $db->sql_freeresult($result); } + + function test_nested_transactions() + { + $db = $this->new_dbal(); + + // nested transactions should work on systems that do not require + // buffering of nested transactions, so ignore the ones that need + // buffering + if ($db->sql_buffer_nested_transactions()) + { + return; + } + + $sql = 'SELECT user_id FROM phpbb_users ORDER BY user_id ASC'; + $result1 = $db->sql_query($sql); + + $db->sql_transaction('begin'); + $result2 = $db->sql_query($sql); + $row = $db->sql_fetchrow($result2); + $db->sql_transaction('commit'); + + $this->assertEquals('1', $row['user_id']); + } } |