diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..d42f83f9 --- /dev/null +++ b/.travis.yml @@ -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 diff --git a/tests/system/base_test.php b/tests/system/base_test.php new file mode 100644 index 00000000..8ce00d12 --- /dev/null +++ b/tests/system/base_test.php @@ -0,0 +1,21 @@ +assertTrue(true); + } +} diff --git a/tests/system/database_base_test.php b/tests/system/database_base_test.php new file mode 100644 index 00000000..c83c5b1c --- /dev/null +++ b/tests/system/database_base_test.php @@ -0,0 +1,43 @@ +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); + } +} diff --git a/tests/system/fixtures/config.xml b/tests/system/fixtures/config.xml new file mode 100644 index 00000000..c23dce67 --- /dev/null +++ b/tests/system/fixtures/config.xml @@ -0,0 +1,13 @@ + + + + config_name + config_value + is_dynamic + + foo + bar + 0 + +
+