From b7b931c50255b99e25ca160d83795f6ae45c2c1a Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Sun, 28 Jun 2015 09:57:14 -0700 Subject: [PATCH 1/6] Fix comment [ci skip] --- acp/board_announcements_module.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/acp/board_announcements_module.php b/acp/board_announcements_module.php index ece2a30..8d670eb 100644 --- a/acp/board_announcements_module.php +++ b/acp/board_announcements_module.php @@ -209,7 +209,7 @@ public function main($id, $mode) 'U_ACTION' => $this->u_action, )); - // Assigning custom bbcodes + // Build custom bbcodes array display_custom_bbcodes(); } } From ca1d40d5da06325137324af387c4d072d1ba2cbc Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Sun, 28 Jun 2015 09:58:21 -0700 Subject: [PATCH 2/6] Ignore vendor directory [ci skip] --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 84c048a..9940a70 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /build/ +/vendor/ From 8dbf7704b9d580ffedd4d08714486f2b716efaba Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Sun, 28 Jun 2015 09:58:33 -0700 Subject: [PATCH 3/6] Update composer.lock [ci skip] --- composer.lock | 173 ++++++++++++++++++++++++++++++++++---------------- 1 file changed, 119 insertions(+), 54 deletions(-) diff --git a/composer.lock b/composer.lock index 71e30e8..5cec18a 100644 --- a/composer.lock +++ b/composer.lock @@ -1,10 +1,10 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "b4482e3af514285f5733ee25aa2eeb11", + "hash": "df4783f9df0fe5c9da15642617b3e1a3", "packages": [ { "name": "composer/installers", @@ -200,18 +200,71 @@ ], "time": "2014-07-23 18:24:17" }, + { + "name": "phing/phing", + "version": "2.4.14", + "source": { + "type": "git", + "url": "https://github.com/phingofficial/phing.git", + "reference": "41075d93ca254f1c90c79ec7ce81be2b2629e138" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phingofficial/phing/zipball/41075d93ca254f1c90c79ec7ce81be2b2629e138", + "reference": "41075d93ca254f1c90c79ec7ce81be2b2629e138", + "shasum": "" + }, + "require": { + "php": ">=5.2.0" + }, + "bin": [ + "bin/phing" + ], + "type": "library", + "autoload": { + "classmap": [ + "classes/phing/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "classes" + ], + "license": [ + "LGPL3" + ], + "authors": [ + { + "name": "Michiel Rook", + "email": "mrook@php.net", + "role": "Lead" + }, + { + "name": "Phing Community", + "homepage": "http://www.phing.info/trac/wiki/Development/Contributors" + } + ], + "description": "PHing Is Not GNU make; it's a PHP project build system or build tool based on Apache Ant.", + "homepage": "http://www.phing.info/", + "keywords": [ + "build", + "task", + "tool" + ], + "time": "2012-11-29 21:23:47" + }, { "name": "phpbb/epv", "version": "dev-master", "source": { "type": "git", "url": "https://github.com/phpbb/epv.git", - "reference": "75df9936ffbb8f05a1351cf622cf6f41c7d2d9f2" + "reference": "a054539914b0dd2c625c4694059730c517e59623" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpbb/epv/zipball/75df9936ffbb8f05a1351cf622cf6f41c7d2d9f2", - "reference": "75df9936ffbb8f05a1351cf622cf6f41c7d2d9f2", + "url": "https://api.github.com/repos/phpbb/epv/zipball/a054539914b0dd2c625c4694059730c517e59623", + "reference": "a054539914b0dd2c625c4694059730c517e59623", "shasum": "" }, "require": { @@ -219,9 +272,10 @@ "nikic/php-parser": "0.9.*@dev", "php": ">=5.3.3", "sensiolabs/ansi-to-html": "~1.1", - "symfony/console": ">=2.3.0", - "symfony/finder": ">=2.3.0", - "symfony/yaml": ">=2.3.0|>=2.4.0|>=2.5.0" + "symfony/console": ">=2.3,<2.7", + "symfony/finder": ">=2.3,<2.7", + "symfony/process": ">=2.3,<2.7", + "symfony/yaml": ">=2.3,<2.7" }, "require-dev": { "phpunit/phpunit": "4.4.*", @@ -247,20 +301,20 @@ } ], "description": "A extension validator for phpBB extensions. Extensions are required to pass the validator when submitted to the extension database.", - "time": "2015-02-12 12:13:06" + "time": "2015-06-26 10:43:47" }, { "name": "sensiolabs/ansi-to-html", - "version": "v1.1.0", + "version": "v1.1.1", "source": { "type": "git", "url": "https://github.com/sensiolabs/ansi-to-html.git", - "reference": "92d2ef7ffba5418be060d8ba8adaf7223d741f93" + "reference": "fd0aa98170e12131ab989c39252df076cff60121" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sensiolabs/ansi-to-html/zipball/92d2ef7ffba5418be060d8ba8adaf7223d741f93", - "reference": "92d2ef7ffba5418be060d8ba8adaf7223d741f93", + "url": "https://api.github.com/repos/sensiolabs/ansi-to-html/zipball/fd0aa98170e12131ab989c39252df076cff60121", + "reference": "fd0aa98170e12131ab989c39252df076cff60121", "shasum": "" }, "require": { @@ -291,21 +345,21 @@ } ], "description": "A library to convert a text with ANSI codes to HTML", - "time": "2014-08-01 14:02:39" + "time": "2015-03-17 06:34:10" }, { "name": "symfony/console", - "version": "v2.6.4", + "version": "v2.6.9", "target-dir": "Symfony/Component/Console", "source": { "type": "git", "url": "https://github.com/symfony/Console.git", - "reference": "e44154bfe3e41e8267d7a3794cd9da9a51cfac34" + "reference": "b5ec0c11a204718f2b656357f5505a8e578f30dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Console/zipball/e44154bfe3e41e8267d7a3794cd9da9a51cfac34", - "reference": "e44154bfe3e41e8267d7a3794cd9da9a51cfac34", + "url": "https://api.github.com/repos/symfony/Console/zipball/b5ec0c11a204718f2b656357f5505a8e578f30dd", + "reference": "b5ec0c11a204718f2b656357f5505a8e578f30dd", "shasum": "" }, "require": { @@ -314,6 +368,7 @@ "require-dev": { "psr/log": "~1.0", "symfony/event-dispatcher": "~2.1", + "symfony/phpunit-bridge": "~2.7", "symfony/process": "~2.1" }, "suggest": { @@ -337,37 +392,40 @@ "MIT" ], "authors": [ - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - }, { "name": "Fabien Potencier", "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], "description": "Symfony Console Component", - "homepage": "http://symfony.com", - "time": "2015-01-25 04:39:26" + "homepage": "https://symfony.com", + "time": "2015-05-29 14:42:58" }, { "name": "symfony/finder", - "version": "v2.6.4", + "version": "v2.6.9", "target-dir": "Symfony/Component/Finder", "source": { "type": "git", "url": "https://github.com/symfony/Finder.git", - "reference": "16513333bca64186c01609961a2bb1b95b5e1355" + "reference": "ffedd3e0ff8155188155e9322fe21b9ee012ac14" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Finder/zipball/16513333bca64186c01609961a2bb1b95b5e1355", - "reference": "16513333bca64186c01609961a2bb1b95b5e1355", + "url": "https://api.github.com/repos/symfony/Finder/zipball/ffedd3e0ff8155188155e9322fe21b9ee012ac14", + "reference": "ffedd3e0ff8155188155e9322fe21b9ee012ac14", "shasum": "" }, "require": { "php": ">=5.3.3" }, + "require-dev": { + "symfony/phpunit-bridge": "~2.7" + }, "type": "library", "extra": { "branch-alias": { @@ -384,37 +442,40 @@ "MIT" ], "authors": [ - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - }, { "name": "Fabien Potencier", "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], "description": "Symfony Finder Component", - "homepage": "http://symfony.com", - "time": "2015-01-03 08:01:59" + "homepage": "https://symfony.com", + "time": "2015-05-15 13:32:45" }, { "name": "symfony/process", - "version": "v2.6.4", + "version": "v2.6.9", "target-dir": "Symfony/Component/Process", "source": { "type": "git", "url": "https://github.com/symfony/Process.git", - "reference": "ecfc23e89d9967999fa5f60a1e9af7384396e9ae" + "reference": "7856d78ab6cce6e59d02d9e1a873441f6bd21306" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Process/zipball/ecfc23e89d9967999fa5f60a1e9af7384396e9ae", - "reference": "ecfc23e89d9967999fa5f60a1e9af7384396e9ae", + "url": "https://api.github.com/repos/symfony/Process/zipball/7856d78ab6cce6e59d02d9e1a873441f6bd21306", + "reference": "7856d78ab6cce6e59d02d9e1a873441f6bd21306", "shasum": "" }, "require": { "php": ">=5.3.3" }, + "require-dev": { + "symfony/phpunit-bridge": "~2.7" + }, "type": "library", "extra": { "branch-alias": { @@ -431,37 +492,40 @@ "MIT" ], "authors": [ - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - }, { "name": "Fabien Potencier", "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], "description": "Symfony Process Component", - "homepage": "http://symfony.com", - "time": "2015-01-25 04:39:26" + "homepage": "https://symfony.com", + "time": "2015-05-15 13:32:45" }, { "name": "symfony/yaml", - "version": "v2.6.4", + "version": "v2.6.9", "target-dir": "Symfony/Component/Yaml", "source": { "type": "git", "url": "https://github.com/symfony/Yaml.git", - "reference": "60ed7751671113cf1ee7d7778e691642c2e9acd8" + "reference": "f157ab074e453ecd4c0fa775f721f6e67a99d9e2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Yaml/zipball/60ed7751671113cf1ee7d7778e691642c2e9acd8", - "reference": "60ed7751671113cf1ee7d7778e691642c2e9acd8", + "url": "https://api.github.com/repos/symfony/Yaml/zipball/f157ab074e453ecd4c0fa775f721f6e67a99d9e2", + "reference": "f157ab074e453ecd4c0fa775f721f6e67a99d9e2", "shasum": "" }, "require": { "php": ">=5.3.3" }, + "require-dev": { + "symfony/phpunit-bridge": "~2.7" + }, "type": "library", "extra": { "branch-alias": { @@ -478,18 +542,18 @@ "MIT" ], "authors": [ - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - }, { "name": "Fabien Potencier", "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], "description": "Symfony Yaml Component", - "homepage": "http://symfony.com", - "time": "2015-01-25 04:39:26" + "homepage": "https://symfony.com", + "time": "2015-05-02 15:18:45" } ], "aliases": [], @@ -498,6 +562,7 @@ "phpbb/epv": 20 }, "prefer-stable": false, + "prefer-lowest": false, "platform": { "php": ">=5.3.3" }, From 0b7c4ce50fd3d9d5be1ffcf315fbecd2b7b770a2 Mon Sep 17 00:00:00 2001 From: rxu Date: Thu, 2 Jul 2015 22:26:29 +0700 Subject: [PATCH 4/6] [issue/87] Enable board announcements for new users. Fixes #87. --- .../m5_enable_announcements_for_new_users.php | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 migrations/v10x/m5_enable_announcements_for_new_users.php diff --git a/migrations/v10x/m5_enable_announcements_for_new_users.php b/migrations/v10x/m5_enable_announcements_for_new_users.php new file mode 100644 index 0000000..4197705 --- /dev/null +++ b/migrations/v10x/m5_enable_announcements_for_new_users.php @@ -0,0 +1,46 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +*/ + +namespace phpbb\boardannouncements\migrations\v10x; + +/** +* Migration stage 5: Enable announcements for new users registered by default +*/ +class m5_enable_announcements_for_new_users extends \phpbb\db\migration\migration +{ + /** + * Assign migration file dependencies for this migration + * + * @return array Array of migration files + * @static + * @access public + */ + static public function depends_on() + { + return array('\phpbb\boardannouncements\migrations\v10x\m4_announcements_dismiss_config'); + } + + /** + * Change default value for the board_announcements_status column from 0 to 1. + * + * @return array Array of table data + * @access public + */ + public function update_schema() + { + return array( + 'change_columns' => array( + $this->table_prefix . 'users' => array( + 'board_announcements_status' => array('BOOL', 1), + ), + ), + ); + } +} From 1da57d27146b49d06c715e147ba92dcc6b1d3173 Mon Sep 17 00:00:00 2001 From: rxu Date: Sat, 4 Jul 2015 12:54:07 +0700 Subject: [PATCH 5/6] [issue/87] Add a test for loading BA as a new user --- .../v10x/m5_enable_announcements_for_new_users.php | 2 +- tests/functional/announcement_test.php | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/migrations/v10x/m5_enable_announcements_for_new_users.php b/migrations/v10x/m5_enable_announcements_for_new_users.php index 4197705..e51e9fd 100644 --- a/migrations/v10x/m5_enable_announcements_for_new_users.php +++ b/migrations/v10x/m5_enable_announcements_for_new_users.php @@ -3,7 +3,7 @@ * * Board Announcements extension for the phpBB Forum Software package. * -* @copyright (c) 2014 phpBB Limited +* @copyright (c) 2015 phpBB Limited * @license GNU General Public License, version 2 (GPL-2.0) * */ diff --git a/tests/functional/announcement_test.php b/tests/functional/announcement_test.php index 80bbcd8..ba275d9 100644 --- a/tests/functional/announcement_test.php +++ b/tests/functional/announcement_test.php @@ -75,6 +75,20 @@ public function test_view_as_user() $this->assertContains('This is a board announcement test.', $crawler->filter('#phpbb_announcement')->text()); } + /** + * Test loading the board announcement as a new just registered user + */ + public function test_view_as_new_user() + { + $this->logout(); + + $this->create_user('new_user1'); + $this->login('new_user1'); + + $crawler = self::request('GET', 'index.php'); + $this->assertContains('This is a board announcement test.', $crawler->filter('#phpbb_announcement')->text()); + } + /** * Test loading the board announcement as a guest */ From dd730b58d0db1a5d414948e172c0dbc15ccce32c Mon Sep 17 00:00:00 2001 From: rxu Date: Sat, 4 Jul 2015 14:49:47 +0700 Subject: [PATCH 6/6] [issue/87] Tiny docblock comment adjustment --- tests/functional/announcement_test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/functional/announcement_test.php b/tests/functional/announcement_test.php index ba275d9..6a46402 100644 --- a/tests/functional/announcement_test.php +++ b/tests/functional/announcement_test.php @@ -76,7 +76,7 @@ public function test_view_as_user() } /** - * Test loading the board announcement as a new just registered user + * Test loading the board announcement as a newly registered user */ public function test_view_as_new_user() {