Skip to content

Commit 02db01a

Browse files
committed
Update testing to use phpBB 3.2.x branch
1 parent 1bb98a4 commit 02db01a

File tree

4 files changed

+22
-23
lines changed

4 files changed

+22
-23
lines changed

.travis.yml

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@ language: php
55

66
matrix:
77
include:
8-
- php: 5.3.3
9-
env: DB=mysqli
10-
- php: 5.3
11-
env: DB=mysqli # MyISAM
128
- php: 5.4
13-
env: DB=mysqli
9+
env: DB=none;NOTESTS=1
10+
- php: 5.4
11+
env: DB=mysqli #myisam
1412
- php: 5.4
1513
env: DB=mysql
1614
- php: 5.4
@@ -23,6 +21,10 @@ matrix:
2321
env: DB=mysqli
2422
- php: 5.6
2523
env: DB=mysqli
24+
- php: 7.0
25+
env: DB=mysqli
26+
- php: 7.1
27+
env: DB=mysqli
2628
- php: hhvm
2729
env: DB=mysqli
2830
allow_failures:
@@ -35,7 +37,7 @@ env:
3537
- SNIFF="1" # Should we run code sniffer on your code?
3638
- IMAGE_ICC="1" # Should we run icc profile sniffer on your images?
3739
- EPV="1" # Should we run EPV (Extension Pre Validator) on your code?
38-
- PHPBB_BRANCH="3.1.x"
40+
- PHPBB_BRANCH="3.2.x"
3941

4042
branches:
4143
only:
@@ -48,14 +50,14 @@ install:
4850
- travis/prepare-phpbb.sh $EXTNAME $PHPBB_BRANCH
4951
- cd ../../phpBB3
5052
- travis/prepare-extension.sh $EXTNAME $PHPBB_BRANCH
51-
- travis/setup-phpbb.sh $DB $TRAVIS_PHP_VERSION
52-
- ../phpbb-extensions/googleanalytics/travis/prepare-epv.sh $EPV $DB $TRAVIS_PHP_VERSION
53+
- travis/setup-phpbb.sh $DB $TRAVIS_PHP_VERSION $NOTESTS
54+
- ../phpbb-extensions/googleanalytics/travis/prepare-epv.sh $EPV $NOTESTS
5355

5456
before_script:
55-
- travis/setup-database.sh $DB $TRAVIS_PHP_VERSION
57+
- travis/setup-database.sh $DB $TRAVIS_PHP_VERSION $NOTESTS
5658

5759
script:
58-
- sh -c "if [ '$SNIFF' != '0' ]; then travis/ext-sniff.sh $DB $TRAVIS_PHP_VERSION $EXTNAME; fi"
59-
- sh -c "if [ '$IMAGE_ICC' != '0' ]; then travis/check-image-icc-profiles.sh $DB $TRAVIS_PHP_VERSION; fi"
60-
- phpBB/vendor/bin/phpunit --configuration phpBB/ext/$EXTNAME/travis/phpunit-$DB-travis.xml --bootstrap ./tests/bootstrap.php
61-
- sh -c "if [ '$EPV' != '0' ] && [ '$TRAVIS_PHP_VERSION' = '5.5' ] && [ '$DB' = 'mysqli' ]; then phpBB/vendor/bin/EPV.php run --dir='phpBB/ext/$EXTNAME/'; fi"
60+
- sh -c "if [ '$SNIFF' != '0' ]; then travis/ext-sniff.sh $DB $TRAVIS_PHP_VERSION $EXTNAME $NOTESTS; fi"
61+
- sh -c "if [ '$IMAGE_ICC' != '0' ]; then travis/check-image-icc-profiles.sh $DB $TRAVIS_PHP_VERSION $NOTESTS; fi"
62+
- sh -c "if [ '$EPV' != '0' ] && [ '$NOTESTS' = '1' ]; then phpBB/vendor/bin/EPV.php run --dir='phpBB/ext/$EXTNAME/'; fi"
63+
- sh -c "if [ '$NOTESTS' != '1' ]; then phpBB/vendor/bin/phpunit --configuration phpBB/ext/$EXTNAME/travis/phpunit-$DB-travis.xml --bootstrap ./tests/bootstrap.php; fi"

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"extra": {
4545
"display-name": "Google Analytics",
4646
"soft-require": {
47-
"phpbb/phpbb": ">=3.1.0,<3.2.0@dev"
47+
"phpbb/phpbb": ">=3.1.0,<3.3"
4848
},
4949
"version-check": {
5050
"host": "www.phpbb.com",

tests/event/listener_test.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,15 @@ public function setUp()
3333
{
3434
parent::setUp();
3535

36-
global $phpbb_dispatcher, $phpbb_extension_manager, $phpbb_root_path;
37-
38-
// Mock some global classes that may be called during code execution
39-
$phpbb_dispatcher = new \phpbb_mock_event_dispatcher();
40-
$phpbb_extension_manager = new \phpbb_mock_extension_manager($phpbb_root_path);
36+
global $phpbb_root_path, $phpEx;
4137

4238
// Load/Mock classes required by the event listener class
4339
$this->config = new \phpbb\config\config(array('googleanalytics_id' => 'UA-000000-01'));
4440
$this->template = $this->getMockBuilder('\phpbb\template\template')
4541
->getMock();
46-
$this->user = new \phpbb\user('\phpbb\datetime');
42+
$lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx);
43+
$lang = new \phpbb\language\language($lang_loader);
44+
$this->user = new \phpbb\user($lang, '\phpbb\datetime');
4745
$this->user->data['user_id'] = 2;
4846
$this->user->data['is_registered'] = true;
4947
}

travis/prepare-epv.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@ set -e
1212
set -x
1313

1414
EPV=$1
15-
DB=$2
16-
TRAVIS_PHP_VERSION=$3
15+
NOTESTS=$2
1716

18-
if [ "$EPV" == "1" -a "$DB" == "mysqli" -a "$TRAVIS_PHP_VERSION" == "5.5" ]
17+
if [ "$EPV" == "1" -a "$NOTESTS" == "1" ]
1918
then
2019
cd phpBB
2120
composer require phpbb/epv:dev-master --dev --no-interaction

0 commit comments

Comments
 (0)