Skip to content

Commit 6a0a05e

Browse files
authored
Merge pull request #79 from VSEphpbb/fixes
Code and Bug Fixes
2 parents e347237 + 9050623 commit 6a0a05e

5 files changed

Lines changed: 12 additions & 9 deletions

File tree

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ branches:
4747
- /^\d+(\.\d+)?\.x$/
4848

4949
install:
50-
- travis/prepare-phpbb.sh $EXTNAME $PHPBB_BRANCH
50+
- travis/prepare-phpbb.sh $PHPBB_BRANCH
5151
- cd ../../phpBB3
5252
- travis/prepare-extension.sh $EXTNAME $PHPBB_BRANCH
5353
- travis/setup-phpbb.sh $DB $TRAVIS_PHP_VERSION $NOTESTS

event/listener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public function add_googleanalytics_configs($event)
125125
*/
126126
public function validate_googleanalytics_id($event)
127127
{
128-
$input = $event['cfg_array']['googleanalytics_id'];
128+
$input = isset($event['cfg_array']['googleanalytics_id']) ? $event['cfg_array']['googleanalytics_id'] : '';
129129

130130
// Check if the validate test is for google_analytics
131131
if ($input !== '' && $event['config_definition']['validate'] === 'googleanalytics_id')

tests/event/listener_test.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
require_once __DIR__ . '/../../../../../includes/functions_acp.php';
1414

15-
class event_listener_test extends \phpbb_test_case
15+
class listener_test extends \phpbb_test_case
1616
{
1717
/** @var \phpbb\googleanalytics\event\listener */
1818
protected $listener;
@@ -199,6 +199,11 @@ public function validate_googleanalytics_id_data()
199199
array('googleanalytics_id' => 'foo-bar-foo'),
200200
array('ACP_GOOGLEANALYTICS_ID_INVALID'),
201201
),
202+
array(
203+
// no googleanalytics_id, no error
204+
array('foo' => 'bar'),
205+
array(),
206+
),
202207
);
203208
}
204209

@@ -211,7 +216,7 @@ public function test_validate_googleanalytics_id($cfg_array, $expected_error)
211216
{
212217
$this->set_listener();
213218

214-
$config_name = 'googleanalytics_id';
219+
$config_name = key($cfg_array);
215220
$config_definition = array('validate' => 'googleanalytics_id');
216221
$error = array();
217222

travis/prepare-epv.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ set -x
1414
EPV=$1
1515
NOTESTS=$2
1616

17-
if [ "$EPV" == "1" -a "$NOTESTS" == "1" ]
17+
if [ "$EPV" == "1" ] && [ "$NOTESTS" == "1" ]
1818
then
1919
cd phpBB
2020
composer remove sami/sami --update-with-dependencies --dev --no-interaction

travis/prepare-phpbb.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,12 @@
1111
set -e
1212
set -x
1313

14-
EXTNAME=$1
15-
BRANCH=$2
16-
EXTPATH_TEMP=$3
14+
BRANCH=$1
1715

1816
# Copy extension to a temp folder
1917
mkdir ../../tmp
2018
cp -R . ../../tmp
2119
cd ../../
2220

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

0 commit comments

Comments
 (0)