aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpBB/styles/prosilver/template/posting_editor.html2
-rw-r--r--tests/functional/browse_test.php3
-rw-r--r--tests/test_framework/phpbb_database_test_connection_manager.php6
-rw-r--r--tests/test_framework/phpbb_functional_test_case.php40
4 files changed, 43 insertions, 8 deletions
diff --git a/phpBB/styles/prosilver/template/posting_editor.html b/phpBB/styles/prosilver/template/posting_editor.html
index 5b3f2beed0..5acdb3a08c 100644
--- a/phpBB/styles/prosilver/template/posting_editor.html
+++ b/phpBB/styles/prosilver/template/posting_editor.html
@@ -165,7 +165,7 @@
<dt><label for="comment_list_{attach_row.ASSOC_INDEX}">{L_FILE_COMMENT}:</label></dt>
<dd><textarea name="comment_list[{attach_row.ASSOC_INDEX}]" id="comment_list_{attach_row.ASSOC_INDEX}" rows="1" cols="35" class="inputbox">{attach_row.FILE_COMMENT}</textarea></dd>
- <dd><a href="{attach_row.U_VIEW_ATTACHMENT}" class="{S_CONTENT_FLOW_END}">{attach_row.FILENAME}</a></dd>
+ <dd><a href="{attach_row.U_VIEW_ATTACHMENT}">{attach_row.FILENAME}</a></dd>
<dd style="margin-top: 5px;">
<!-- IF S_INLINE_ATTACHMENT_OPTIONS --><input type="button" value="{L_PLACE_INLINE}" onclick="attach_inline({attach_row.ASSOC_INDEX}, '{attach_row.A_FILENAME}');" class="button2" />&nbsp; <!-- ENDIF -->
<input type="submit" name="delete_file[{attach_row.ASSOC_INDEX}]" value="{L_DELETE_FILE}" class="button2" />
diff --git a/tests/functional/browse_test.php b/tests/functional/browse_test.php
index 26c18c4c1f..b5748059c6 100644
--- a/tests/functional/browse_test.php
+++ b/tests/functional/browse_test.php
@@ -15,18 +15,21 @@ class phpbb_functional_browse_test extends phpbb_functional_test_case
public function test_index()
{
$crawler = $this->request('GET', 'index.php');
+ $this->assert_response_success();
$this->assertGreaterThan(0, $crawler->filter('.topiclist')->count());
}
public function test_viewforum()
{
$crawler = $this->request('GET', 'viewforum.php?f=2');
+ $this->assert_response_success();
$this->assertGreaterThan(0, $crawler->filter('.topiclist')->count());
}
public function test_viewtopic()
{
$crawler = $this->request('GET', 'viewtopic.php?t=1');
+ $this->assert_response_success();
$this->assertGreaterThan(0, $crawler->filter('.postbody')->count());
}
}
diff --git a/tests/test_framework/phpbb_database_test_connection_manager.php b/tests/test_framework/phpbb_database_test_connection_manager.php
index 25e0972f42..a43215bcf2 100644
--- a/tests/test_framework/phpbb_database_test_connection_manager.php
+++ b/tests/test_framework/phpbb_database_test_connection_manager.php
@@ -166,12 +166,6 @@ class phpbb_database_test_connection_manager
switch ($this->config['dbms'])
{
case 'sqlite':
- if (file_exists($this->config['dbhost']))
- {
- unlink($this->config['dbhost']);
- }
- break;
-
case 'firebird':
$this->connect();
// Drop all of the tables
diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php
index d35913e415..7c03f874e9 100644
--- a/tests/test_framework/phpbb_functional_test_case.php
+++ b/tests/test_framework/phpbb_functional_test_case.php
@@ -9,11 +9,14 @@
use Symfony\Component\BrowserKit\CookieJar;
require_once __DIR__ . '/../../phpBB/includes/functions_install.php';
+require_once __DIR__ . '/../../phpBB/includes/acm/acm_file.php';
+require_once __DIR__ . '/../../phpBB/includes/cache.php';
class phpbb_functional_test_case extends phpbb_test_case
{
protected $client;
protected $root_url;
+ protected $cache = null;
/**
* Session ID for current test's session (each test makes its own)
@@ -47,6 +50,7 @@ class phpbb_functional_test_case extends phpbb_test_case
// that were added in other tests are gone
$this->lang = array();
$this->add_lang('common');
+ $this->purge_cache();
}
public function request($method, $path)
@@ -61,6 +65,25 @@ class phpbb_functional_test_case extends phpbb_test_case
{
}
+ protected function get_cache_driver()
+ {
+ if (!$this->cache)
+ {
+ $this->cache = new cache();
+ }
+
+ return $this->cache;
+ }
+
+ protected function purge_cache()
+ {
+ $cache = $this->get_cache_driver();
+
+ $cache->purge();
+ $cache->unload();
+ $cache->load();
+ }
+
public function __construct($name = NULL, array $data = array(), $dataName = '')
{
parent::__construct($name, $data, $dataName);
@@ -182,7 +205,7 @@ class phpbb_functional_test_case extends phpbb_test_case
$login = $this->client->submit($form, array('username' => 'admin', 'password' => 'admin'));
$cookies = $this->cookieJar->all();
-
+
// The session id is stored in a cookie that ends with _sid - we assume there is only one such cookie
foreach ($cookies as $cookie);
{
@@ -229,4 +252,19 @@ class phpbb_functional_test_case extends phpbb_test_case
return call_user_func_array('sprintf', $args);
}
+
+ /**
+ * Heuristic function to check that the response is success.
+ *
+ * When php decides to die with a fatal error, it still sends 200 OK
+ * status code. This assertion tries to catch that.
+ *
+ * @return null
+ */
+ public function assert_response_success()
+ {
+ $this->assertEquals(200, $this->client->getResponse()->getStatus());
+ $content = $this->client->getResponse()->getContent();
+ $this->assertNotContains('Fatal error:', $content);
+ }
}