Skip to content

Commit 6a57328

Browse files
committed
Merge pull request #1 from nickvergessen/functional-tests
Functional tests
2 parents af5d26b + 3706cba commit 6a57328

File tree

5 files changed

+68
-44
lines changed

5 files changed

+68
-44
lines changed

.travis.yml

Lines changed: 33 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,42 @@
11
language: php
2-
php:
3-
- 5.3.3
4-
- 5.3
5-
- 5.4
6-
- 5.5
7-
- 5.6
8-
- hhvm
2+
3+
matrix:
4+
include:
5+
- php: 5.3.3
6+
env: DB=mysqli
7+
- php: 5.3
8+
env: DB=mysqli # MyISAM
9+
- php: 5.4
10+
env: DB=mysqli
11+
- php: 5.4
12+
env: DB=mysql
13+
- php: 5.4
14+
env: DB=mariadb
15+
- php: 5.4
16+
env: DB=postgres
17+
- php: 5.4
18+
env: DB=sqlite3
19+
- php: 5.5
20+
env: DB=mysqli
21+
- php: 5.6
22+
env: DB=mysqli
23+
- php: hhvm
24+
env: DB=mysqli
25+
allow_failures:
26+
- php: hhvm
27+
fast_finish: true
928

1029
env:
1130
global:
12-
- EXTNAME="phpbbde/movemessage"
13-
- SNIFF="0"
14-
- PHPBB_BRANCH="ticket/12483" # - PHPBB_BRANCH="develop-ascraeus"
15-
matrix:
16-
- DB=mysql
31+
- EXTNAME="phpbbde/movemessage" # CHANGE name of the extension HERE
32+
- SNIFF="1" # Should we run code sniffer on your code?
33+
- IMAGE_ICC="1" # Should we run icc profile sniffer on your images?
34+
- PHPBB_BRANCH="develop-ascraeus"
1735

1836
branches:
1937
only:
2038
- master
39+
- develop
2140
- /^develop-.*$/
2241

2342
install:
@@ -30,17 +49,6 @@ before_script:
3049
- travis/setup-database.sh $DB $TRAVIS_PHP_VERSION
3150

3251
script:
33-
- sh -c "if [ '$SNIFF' != '0' ]; then travis/phing-sniff.sh $DB $TRAVIS_PHP_VERSION; fi"
52+
- sh -c "if [ '$SNIFF' != '0' ]; then travis/ext-sniff.sh $DB $TRAVIS_PHP_VERSION $EXTNAME; fi"
53+
- sh -c "if [ '$IMAGE_ICC' != '0' ]; then travis/check-image-icc-profiles.sh $DB $TRAVIS_PHP_VERSION; fi"
3454
- phpBB/vendor/bin/phpunit --configuration phpBB/ext/$EXTNAME/travis/phpunit-$DB-travis.xml --bootstrap ./tests/bootstrap.php
35-
36-
matrix:
37-
include:
38-
- php: 5.4
39-
env: DB=mariadb
40-
- php: 5.4
41-
env: DB=postgres
42-
- php: 5.4
43-
env: DB=sqlite3
44-
allow_failures:
45-
- php: hhvm
46-
fast_finish: true

composer.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@
2121
}
2222
],
2323
"require": {
24-
"php": ">=5.3",
25-
"phpbb/phpbb": "3.1.*@dev"
24+
"php": ">=5.3.3"
2625
},
2726
"extra": {
28-
"display-name": "phpBB.de - Move Message"
27+
"display-name": "phpBB.de - Move Message",
28+
"soft-require": {
29+
"phpbb/phpbb": "3.1.*@dev"
30+
}
2931
}
3032
}

event/main_listener.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ static public function getSubscribedEvents()
6969
* @param \phpbb\db\driver\driver_interface $db
7070
* @param \phpbb\template\template $template
7171
* @param \phpbb\user $user
72+
* @param string $phpbb_root_path
73+
* @param string $phpEx
7274
*/
7375
public function __construct(\phpbb\auth\auth $auth, \phpbb\content_visibility $content_visibility, \phpbb\db\driver\driver_interface $db, \phpbb\template\template $template, \phpbb\user $user, $phpbb_root_path, $phpEx)
7476
{

ext.php

Lines changed: 0 additions & 16 deletions
This file was deleted.

tests/functional/install_test.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
3+
/**
4+
*
5+
* @package phpBB.de Move Message
6+
* @copyright (c) 2014 phpBB.de
7+
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
8+
*
9+
*/
10+
11+
namespace phpbbde\movemessage\tests\functional;
12+
13+
/**
14+
* @group functional
15+
*/
16+
class install_test extends \phpbb_functional_test_case
17+
{
18+
static protected function setup_extensions()
19+
{
20+
return array('phpbbde/movemessage');
21+
}
22+
23+
public function test_validate_viewtopic()
24+
{
25+
$crawler = self::request('GET', 'viewtopic.php?f=1&t=1');
26+
$this->assertContains('Welcome to phpBB3', $crawler->filter('h2')->text());
27+
}
28+
}

0 commit comments

Comments
 (0)