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
34 changes: 16 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,24 @@
language: php
dist: trusty
dist: xenial

matrix:
include:
- php: 5.5
- php: 7.1
env: DB=none;NOTESTS=1
- php: 5.4
env: DB=mysqli #myisam
- php: 5.4
env: DB=mysql
- php: 5.4
- php: 7.1
env: DB=mariadb
- php: 5.4
- php: 7.1
env: DB=postgres
- php: 5.4
- php: 7.1
env: DB=sqlite3
- php: 5.5
env: DB=mysqli
- php: 5.6
env: DB=mysqli
- php: 7.0
env: DB=mysqli
- php: 7.1
env: DB=mysqli
env: DB=mysqli # MyISAM
- php: 7.2
env: DB=mysqli
- php: 7.3
env: DB=mysqli
- php: 7.4snapshot
env: DB=mysqli
- php: nightly
env: DB=mysqli
allow_failures:
Expand All @@ -37,7 +31,7 @@ env:
- SNIFF="1" # Should we run code sniffer on your code?
- IMAGE_ICC="1" # Should we run icc profile sniffer on your images?
- EPV="1" # Should we run EPV (Extension Pre Validator) on your code?
- PHPBB_BRANCH="3.2.x"
- PHPBB_BRANCH="3.3.x"

branches:
only:
Expand All @@ -46,8 +40,12 @@ branches:
- /^develop-.*$/
- /^\d+(\.\d+)?\.x$/

services:
- postgresql
- mysql

install:
- travis/prepare-phpbb.sh $EXTNAME $PHPBB_BRANCH
- travis/prepare-phpbb.sh $PHPBB_BRANCH
- cd ../../phpBB3
- travis/prepare-extension.sh $EXTNAME $PHPBB_BRANCH
- travis/setup-phpbb.sh $DB $TRAVIS_PHP_VERSION $NOTESTS
Expand Down
6 changes: 1 addition & 5 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
verbose="true"
bootstrap="../../../../tests/bootstrap.php"
>
Expand All @@ -18,14 +17,11 @@
<exclude>./tests/functional</exclude>
</testsuite>
<testsuite name="Extension Functional Tests">
<directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">./tests/functional/</directory>
<directory suffix="_test.php">./tests/functional/</directory>
</testsuite>
</testsuites>

<filter>
<blacklist>
<directory>./tests/</directory>
</blacklist>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./</directory>
<exclude>
Expand Down
5 changes: 2 additions & 3 deletions tests/event/email_change_notification_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,9 @@ public function test_email_change_notification($listener, $enabled, $in_watch_gr

$this->set_listener();

$this->listener->expects($this->any())
$this->listener->expects($this->atMost(1))
->method('in_watch_group')
->will($this->returnValue($in_watch_group)
);
->willReturn($in_watch_group);

// Check send_message once if conditions are true,
// otherwise check that it is never called.
Expand Down
5 changes: 2 additions & 3 deletions tests/event/failed_logins_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,9 @@ public function test_log_failed_login_attempts($enabled, $in_watch_group, $resul

$this->set_listener();

$this->listener->expects($this->any())
$this->listener->expects($this->atMost(1))
->method('in_watch_group')
->will($this->returnValue($in_watch_group)
);
->willReturn($in_watch_group);

// Check log->add is called once with expected data if enabled and in_watch_group are true,
// otherwise check that it is never called.
Expand Down
5 changes: 2 additions & 3 deletions tests/event/team_passwords_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,9 @@ public function test_set_team_password_configs($listener, $mode, $user_row, $sec

$this->set_listener();

$this->listener->expects($this->any())
$this->listener->expects($this->atMost(1))
->method('in_watch_group')
->will($this->returnValue($in_watch_group)
);
->willReturn($in_watch_group);

$dispatcher = new \Symfony\Component\EventDispatcher\EventDispatcher();
$dispatcher->addListener($listener, array($this->listener, 'set_team_password_configs'));
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/functional_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
class functional_test extends \phpbb_functional_test_case
{
static protected function setup_extensions()
protected static function setup_extensions()
{
return array('phpbb/teamsecurity');
}
Expand Down
2 changes: 1 addition & 1 deletion travis/prepare-epv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ set -x
EPV=$1
NOTESTS=$2

if [ "$EPV" == "1" -a "$NOTESTS" == "1" ]
if [ "$EPV" == "1" ] && [ "$NOTESTS" == "1" ]
then
cd phpBB
composer remove sami/sami --update-with-dependencies --dev --no-interaction
Expand Down
6 changes: 2 additions & 4 deletions travis/prepare-phpbb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,12 @@
set -e
set -x

EXTNAME=$1
BRANCH=$2
EXTPATH_TEMP=$3
BRANCH=$1

# Copy extension to a temp folder
mkdir ../../tmp
cp -R . ../../tmp
cd ../../

# Clone phpBB
git clone --depth=1 "git://github.com/phpbb/phpbb.git" "phpBB3" --branch=$BRANCH
git clone --depth=1 "git://github.com/phpbb/phpbb.git" "phpBB3" --branch="$BRANCH"