Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
language: php
php:
- 5.3.3
- 5.3
- 5.4
- 5.5

env:
- DB=mariadb
- DB=mysql
- DB=postgres

before_script:
# MUST UPDATE THIS FOR YOUR EXTENSION
- VENDOR="phpbb"
- NAME="boardrules"

# clone phpBB
- git clone "git://github.com/phpbb-extensions/test-framework.git" "./../../test-framework"

# run the prepare-travis.sh file from the cloned repo to finish the setup
- ./../../test-framework/prepare-travis.sh "$VENDOR" "$NAME" "$DB"

# Go to the root phpBB repository that was cloned from prepare-travis.sh,
# so the script path and relative paths are correct
- cd ../../phpbb

script:
- ./phpBB/vendor/bin/phpunit --configuration ./phpBB/ext/$VENDOR/$NAME/travis/phpunit-$DB-travis.xml
21 changes: 21 additions & 0 deletions tests/system/base_test.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php
/**
*
* @package testing
* @copyright (c) 2013 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/

class extension_system_base_test extends phpbb_test_case
{
/**
* Very basic test we're running here
*
* Mostly just to check that our test case is running
*/
public function test_check()
{
$this->assertTrue(true);
}
}
43 changes: 43 additions & 0 deletions tests/system/database_base_test.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php
/**
*
* @package testing
* @copyright (c) 2013 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/

class extension_system_database_base_test extends phpbb_database_test_case
{
public function getDataSet()
{
return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/config.xml');
}

public function setUp()
{
parent::setUp();

$this->db = $this->new_dbal();
}

/**
* Very basic test we're running here
*
* Mostly just to check that our test case is running
*/
public function test_check()
{
$sql = 'SELECT *
FROM phpbb_config';
$result = $this->db->sql_query($sql);
$this->assertEquals(array(
array(
'config_name' => 'foo',
'config_value' => 'bar',
'is_dynamic' => '0',
),
), $this->db->sql_fetchrowset($result));
$this->db->sql_freeresult($result);
}
}
13 changes: 13 additions & 0 deletions tests/system/fixtures/config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" ?>
<dataset>
<table name="phpbb_config">
<column>config_name</column>
<column>config_value</column>
<column>is_dynamic</column>
<row>
<value>foo</value>
<value>bar</value>
<value>0</value>
</row>
</table>
</dataset>