aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/session/creation_test.php (renamed from tests/session/init_test.php)7
-rw-r--r--tests/template/template_test.php19
2 files changed, 19 insertions, 7 deletions
diff --git a/tests/session/init_test.php b/tests/session/creation_test.php
index 2ce6c4a4ac..bef52c6554 100644
--- a/tests/session/init_test.php
+++ b/tests/session/creation_test.php
@@ -10,7 +10,7 @@
require_once dirname(__FILE__) . '/../mock/cache.php';
require_once dirname(__FILE__) . '/testable_factory.php';
-class phpbb_session_init_test extends phpbb_database_test_case
+class phpbb_session_creation_test extends phpbb_database_test_case
{
public function getDataSet()
{
@@ -35,10 +35,11 @@ class phpbb_session_init_test extends phpbb_database_test_case
$this->assertSqlResultEquals(
array(array('session_user_id' => 3)),
$sql,
- 'Check if exacly one session for user id 3 was created'
+ 'Check if exactly one session for user id 3 was created'
);
- $cookie_expire = $session->time_now + 31536000; // default is one year
+ $one_year_in_seconds = 365 * 24 * 60 * 60;
+ $cookie_expire = $session->time_now + $one_year_in_seconds;
$session->check_cookies($this, array(
'u' => array(null, $cookie_expire),
diff --git a/tests/template/template_test.php b/tests/template/template_test.php
index e532de294c..fd68124c89 100644
--- a/tests/template/template_test.php
+++ b/tests/template/template_test.php
@@ -69,9 +69,14 @@ class phpbb_template_template_test extends phpbb_test_case
$this->markTestSkipped("Template cache directory ({$template_cache_dir}) is not writable.");
}
- foreach (glob($this->template->cachepath . '*') as $file)
+ $file_array = scandir($template_cache_dir);
+ $file_prefix = basename($this->template->cachepath);
+ foreach ($file_array as $file)
{
- unlink($file);
+ if (strpos($file, $file_prefix) === 0)
+ {
+ unlink($template_cache_dir . '/' . $file);
+ }
}
$GLOBALS['config'] = array(
@@ -84,9 +89,15 @@ class phpbb_template_template_test extends phpbb_test_case
{
if (is_object($this->template))
{
- foreach (glob($this->template->cachepath . '*') as $file)
+ $template_cache_dir = dirname($this->template->cachepath);
+ $file_array = scandir($template_cache_dir);
+ $file_prefix = basename($this->template->cachepath);
+ foreach ($file_array as $file)
{
- unlink($file);
+ if (strpos($file, $file_prefix) === 0)
+ {
+ unlink($template_cache_dir . '/' . $file);
+ }
}
}
}