aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/controller/controller_test.php4
-rw-r--r--tests/controller/ext/vendor2/foo/subfolder/config/routing.yml3
-rw-r--r--tests/mock/session_testable.php2
-rw-r--r--tests/session/fixtures/sessions_key.xml1
-rw-r--r--tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/test_event_subloop.html4
-rw-r--r--tests/template/template_events_test.php1
-rw-r--r--tests/template/template_test.php1
-rw-r--r--tests/template/templates/loop_nested_include1.html4
-rw-r--r--tests/test_framework/phpbb_database_test_connection_manager.php22
-rw-r--r--tests/test_framework/phpbb_test_case_helpers.php14
10 files changed, 45 insertions, 11 deletions
diff --git a/tests/controller/controller_test.php b/tests/controller/controller_test.php
index 550679ff07..7d9fe652eb 100644
--- a/tests/controller/controller_test.php
+++ b/tests/controller/controller_test.php
@@ -8,8 +8,6 @@
*/
use Symfony\Component\HttpFoundation\Request;
-use Symfony\Component\Routing\Route;
-use Symfony\Component\Routing\RouteCollection;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
@@ -43,6 +41,8 @@ class phpbb_controller_controller_test extends phpbb_test_case
$this->assertInstanceOf('Symfony\Component\Routing\Route', $routes->get('controller2'));
$this->assertEquals('/foo/bar', $routes->get('controller2')->getPath());
+
+ $this->assertNull($routes->get('controller_noroute'));
}
public function test_controller_resolver()
diff --git a/tests/controller/ext/vendor2/foo/subfolder/config/routing.yml b/tests/controller/ext/vendor2/foo/subfolder/config/routing.yml
new file mode 100644
index 0000000000..b4d8d19107
--- /dev/null
+++ b/tests/controller/ext/vendor2/foo/subfolder/config/routing.yml
@@ -0,0 +1,3 @@
+controller_noroute:
+ pattern: /donotfindthis
+ defaults: { _controller: foo.controller:handle }
diff --git a/tests/mock/session_testable.php b/tests/mock/session_testable.php
index d81ae3163e..a2a403727b 100644
--- a/tests/mock/session_testable.php
+++ b/tests/mock/session_testable.php
@@ -20,7 +20,7 @@ class phpbb_mock_session_testable extends \phpbb\session
{
private $_cookies = array();
- public function set_cookie($name, $data, $time)
+ public function set_cookie($name, $data, $time, $httponly = true)
{
$this->_cookies[$name] = array($data, $time);
}
diff --git a/tests/session/fixtures/sessions_key.xml b/tests/session/fixtures/sessions_key.xml
index 4f349cd282..245f89a604 100644
--- a/tests/session/fixtures/sessions_key.xml
+++ b/tests/session/fixtures/sessions_key.xml
@@ -22,7 +22,6 @@
<value>4</value>
<value>127.0.0.1</value>
<value>user agent</value>
- <value>1</value>
</row>
</table>
<table name="phpbb_users">
diff --git a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/test_event_subloop.html b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/test_event_subloop.html
index 4fdba859f3..98fa1770ba 100644
--- a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/test_event_subloop.html
+++ b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/test_event_subloop.html
@@ -1,2 +1,2 @@
-[{event_loop.S_ROW_COUNT}<!-- BEGIN subloop -->[subloop:{event_loop.subloop.S_ROW_COUNT}]
-<!-- END subloop -->]
+[{event_loop.S_ROW_COUNT}<!-- BEGIN event_loop.subloop -->[subloop:{event_loop.subloop.S_ROW_COUNT}]
+<!-- END event_loop.subloop -->]
diff --git a/tests/template/template_events_test.php b/tests/template/template_events_test.php
index d09f22944f..866d42d831 100644
--- a/tests/template/template_events_test.php
+++ b/tests/template/template_events_test.php
@@ -102,7 +102,6 @@ Zeta test event in all',
),
array(),
'event_loop[0[subloop:0]]',
- 'Event files are missing opened parent loops: PHPBB3-12382',
),
);
}
diff --git a/tests/template/template_test.php b/tests/template/template_test.php
index 49804c26c5..0d19e7afd1 100644
--- a/tests/template/template_test.php
+++ b/tests/template/template_test.php
@@ -330,7 +330,6 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
array(),
"[bar|[bar|]][bar1|[bar1|[bar1|works]]]",
array(),
- 'Included files are missing opened parent loops: PHPBB3-12382',
),
/* Does not pass with the current implementation.
array(
diff --git a/tests/template/templates/loop_nested_include1.html b/tests/template/templates/loop_nested_include1.html
index 0f1a180b4d..88efffc99c 100644
--- a/tests/template/templates/loop_nested_include1.html
+++ b/tests/template/templates/loop_nested_include1.html
@@ -1,5 +1,5 @@
[{test_loop.foo}|
-<!-- BEGIN inner -->
+<!-- BEGIN test_loop.inner -->
[{test_loop.foo}|
{test_loop.inner.myinner}]
-<!-- END inner -->]
+<!-- END test_loop.inner -->]
diff --git a/tests/test_framework/phpbb_database_test_connection_manager.php b/tests/test_framework/phpbb_database_test_connection_manager.php
index 887dad5b50..796a6e57cf 100644
--- a/tests/test_framework/phpbb_database_test_connection_manager.php
+++ b/tests/test_framework/phpbb_database_test_connection_manager.php
@@ -53,6 +53,7 @@ class phpbb_database_test_connection_manager
switch ($this->dbms['PDO'])
{
case 'sqlite2':
+ case 'sqlite': // SQLite3 driver
$dsn .= $this->config['dbhost'];
break;
@@ -191,6 +192,7 @@ class phpbb_database_test_connection_manager
switch ($this->config['dbms'])
{
case 'phpbb\db\driver\sqlite':
+ case 'phpbb\db\driver\sqlite3':
case 'phpbb\db\driver\firebird':
$this->connect();
// Drop all of the tables
@@ -272,6 +274,13 @@ class phpbb_database_test_connection_manager
WHERE type = "table"';
break;
+ case 'phpbb\db\driver\sqlite3':
+ $sql = 'SELECT name
+ FROM sqlite_master
+ WHERE type = "table"
+ AND name <> "sqlite_sequence"';
+ break;
+
case 'phpbb\db\driver\mssql':
case 'phpbb\db\driver\mssql_odbc':
case 'phpbb\db\driver\mssqlnative':
@@ -436,6 +445,11 @@ class phpbb_database_test_connection_manager
'DELIM' => ';',
'PDO' => 'sqlite2',
),
+ 'phpbb\db\driver\sqlite3' => array(
+ 'SCHEMA' => 'sqlite',
+ 'DELIM' => ';',
+ 'PDO' => 'sqlite',
+ ),
);
if (isset($available_dbms[$dbms]))
@@ -623,6 +637,14 @@ class phpbb_database_test_connection_manager
$queries[] = 'SELECT ' . implode(', ', $setval_queries);
}
break;
+
+ case 'phpbb\db\driver\sqlite3':
+ /**
+ * Just delete all of the sequences. When an insertion occurs, the sequence will be automatically
+ * re-created from the key with the AUTOINCREMENT attribute
+ */
+ $queries[] = 'DELETE FROM sqlite_sequence';
+ break;
}
foreach ($queries as $query)
diff --git a/tests/test_framework/phpbb_test_case_helpers.php b/tests/test_framework/phpbb_test_case_helpers.php
index 2f225fe7af..aba63a0498 100644
--- a/tests/test_framework/phpbb_test_case_helpers.php
+++ b/tests/test_framework/phpbb_test_case_helpers.php
@@ -104,7 +104,19 @@ class phpbb_test_case_helpers
{
$config = array();
- if (extension_loaded('sqlite') && version_compare(PHPUnit_Runner_Version::id(), '3.4.15', '>='))
+
+ if (extension_loaded('sqlite3'))
+ {
+ $config = array_merge($config, array(
+ 'dbms' => 'phpbb\db\driver\sqlite3',
+ 'dbhost' => dirname(__FILE__) . '/../phpbb_unit_tests.sqlite3', // filename
+ 'dbport' => '',
+ 'dbname' => '',
+ 'dbuser' => '',
+ 'dbpasswd' => '',
+ ));
+ }
+ else if (extension_loaded('sqlite'))
{
$config = array_merge($config, array(
'dbms' => 'phpbb\db\driver\sqlite',