From 8d4ed0465414ea434346de5312181afb40ada0b6 Mon Sep 17 00:00:00 2001 From: Johan Cwiklinski Date: Wed, 11 Oct 2023 19:19:20 +0200 Subject: [PATCH] Do not rely on website for tests; closes #1721 --- tests/Galette/IO/tests/units/News.php | 12 +- tests/feed.xml | 239 ++++++++++++++++++++++++++ 2 files changed, 246 insertions(+), 5 deletions(-) create mode 100644 tests/feed.xml diff --git a/tests/Galette/IO/tests/units/News.php b/tests/Galette/IO/tests/units/News.php index ac9084ada..487ba46ba 100644 --- a/tests/Galette/IO/tests/units/News.php +++ b/tests/Galette/IO/tests/units/News.php @@ -52,6 +52,7 @@ use PHPUnit\Framework\TestCase; */ class News extends TestCase { + private string $local_url; private \Galette\Core\I18n $i18n; /** @@ -64,6 +65,7 @@ class News extends TestCase $this->i18n = new \Galette\Core\I18n(); global $i18n; $i18n = $this->i18n; + $this->local_url = 'file:///' . realpath(GALETTE_ROOT . '../tests/feed.xml'); } /** @@ -76,7 +78,7 @@ class News extends TestCase //ensure allow_url_fopen is on ini_set('allow_url_fopen', true); //load news without caching - $news = new \Galette\IO\News('https://galette.eu/site/feed.xml', true); + $news = new \Galette\IO\News($this->local_url, true); $posts = $news->getPosts(); $this->assertGreaterThan(0, count($posts)); } @@ -89,13 +91,13 @@ class News extends TestCase public function testCacheNews() { //will use default lang to build RSS URL - $file = GALETTE_CACHE_DIR . md5('https://galette.eu/site/feed.xml') . '.cache'; + $file = GALETTE_CACHE_DIR . md5($this->local_url) . '.cache'; //ensure file does not exist $this->assertFalse(file_exists($file)); //load news with caching - $news = new \Galette\IO\News('https://galette.eu/site/feed.xml'); + $news = new \Galette\IO\News($this->local_url); $posts = $news->getPosts(); $this->assertGreaterThan(0, count($posts)); @@ -118,7 +120,7 @@ class News extends TestCase $touched = touch($file, $expired->getTimestamp()); $this->assertTrue($touched); - $news = new \Galette\IO\News('https://galette.eu/site/feed.xml'); + $news = new \Galette\IO\News($this->local_url); $mnewdate = \DateTime::createFromFormat( $dformat, date( @@ -142,7 +144,7 @@ class News extends TestCase public function testLoadNewsWExeption() { $news = $this->getMockBuilder(\Galette\IO\News::class) - ->setConstructorArgs(array('https://galette.eu/site/feed.xml', true)) + ->setConstructorArgs(array($this->local_url, true)) ->onlyMethods(array('allowURLFOpen')) ->getMock(); $news->method('allowURLFOpen')->willReturn(false); diff --git a/tests/feed.xml b/tests/feed.xml new file mode 100644 index 000000000..9d178cb39 --- /dev/null +++ b/tests/feed.xml @@ -0,0 +1,239 @@ + +Jekyll2023-10-11T19:16:11+02:00https://galette.eu/site/feed.xmlGaletteGestionnaire d'Adhérents en Ligne Extrêmement Tarabiscoté mais Tellement EfficaceJohan CwiklinskiGalette 1.0.0rc12023-09-06T08:00:00+02:002023-09-06T08:00:00+02:00https://galette.eu/site/post/2023/09/06/galette-1-0-0rc1<p>After months of work, I’m very pleased to announce Galette is on the road to the 1.0.0 release!</p> + +<p>Latest stable version is now quite old and is not fully compatible with recent PHP releases.</p> + +<p>Fortunately, database schema has not been changed at all, you can take an eye to 1.0.0 keeping your existing data as is. Don’t forget to do a backup anyway, keep in mind this is a RC release.</p> + +<p>Under the hood, a lot of work has been done to improve code quality and maintainability; we also have switched from quite dead third party libraries to more recent/maintained ones.</p> + +<ul> + <li>Modern UI</li> + <li>Template rendering is now assumed by Twig instead of Smarty</li> + <li>LibreJS compatibility</li> + <li>Major improvements on UI/UX and also responsiveness</li> + <li>Use of YAML files instead of XML for exports configuration</li> + <li>New preference to show/hide borders around PDF member cards</li> + <li>WebP image support</li> + <li>…</li> +</ul> + +<p>See <a href="https://doc.galette.eu/en/develop/changelog.html#v1000">Galette 1.0.0 changelog</a> for all details.</p> + +<p>All plugins needs to be updated as well, use the nightly archive available for each one, see <a href="https://doc.galette.eu/en/develop/plugins/">plugins documentation</a> ;-)</p> + +<p style="text-align: center;"><a href="https://download.tuxfamily.org/galette/dev/galette-1.0.0-rc1-20230905-cd4d1429cd.tar.bz2"><img src="https://img.shields.io/badge/1.0.0rc1-Download_Galette-ffb619.svg?logo=php&amp;logoColor=white&amp;style=for-the-badge" alt="Download Galette 1.0.0rc1" /></a></p> + +<p>Hope you will enjoy this release; happy Galette!</p>Johan C.After months of work, I’m very pleased to announce Galette is on the road to the 1.0.0 release!Galette new release (0.9.6.1)!2021-12-16T05:50:00+01:002021-12-16T05:50:00+01:00https://galette.eu/site/post/2021/12/16/galette-0-9-6-1<p>A very big thank to everyone involved in this release :)</p> + +<p>This is a minor release, providing several bugfixes and some background enhancements:</p> + +<ul> + <li>Fix language detection priority not respected</li> + <li>No composer platform check</li> + <li>Fix html2text for php 8</li> + <li>Fix social networks replacements</li> +</ul> + +<p>See <a href="https://doc.galette.eu/en/master/changelog.html#v0961">Galette 0.9.6.1 changelog</a> for all details.</p> + +<p style="text-align: center;"><a href="https://download.tuxfamily.org/galette/galette-0.9.6.1.tar.bz2"><img src="https://img.shields.io/badge/0.9.6.1-Download_Galette-ffb619.svg?logo=php&amp;logoColor=white&amp;style=for-the-badge" alt="Download Galette 0.9.6.1" /></a></p> + +<p>Hope you will enjoy this release; happy Galette!</p>Johan C.A very big thank to everyone involved in this release :)Galette new major release (0.9.6)!2021-11-29T18:11:57+01:002021-11-29T18:11:57+01:00https://galette.eu/site/post/2021/11/29/galette-0-9-6<p>This is a major release, which brings a few new features and bugfixes as usual, but this one also fix some security issues (CVE-2021-41262, CVE-2021-41261, CVE-2021-41260).</p> + +<p><strong>Upgrade is highly recommended.</strong></p> + +<ul> + <li>Social networks/contact externalization</li> + <li>Add member number</li> + <li>Export contributions as CSV</li> + <li>Drop group name uniqueness at same level</li> + <li>Add CSRF protection</li> + <li>Enhance groups managers capacities</li> + <li>…</li> +</ul> + +<p>See <a href="https://doc.galette.eu/en/master/changelog.html#v0960">Galette 0.9.6 changelog</a> for all details.</p> + +<p>Unfortunately, some required background changes (CSRF checks) has made almost all plugins incompatible, and it is required to update them, see <a href="https://doc.galette.eu/en/master/plugins/">plugins documentation</a> ;-)</p> + +<p style="text-align: center;"><a href="https://download.tuxfamily.org/galette/galette-0.9.6.tar.bz2"><img src="https://img.shields.io/badge/0.9.6-Download_Galette-ffb619.svg?logo=php&amp;logoColor=white&amp;style=for-the-badge" alt="Download Galette 0.9.6" /></a></p> + +<p>Hope you will enjoy this release; happy Galette!</p>Johan C.This is a major release, which brings a few new features and bugfixes as usual, but this one also fix some security issues (CVE-2021-41262, CVE-2021-41261, CVE-2021-41260).Galette new release (0.9.5.2)!2021-11-07T06:50:00+01:002021-11-07T06:50:00+01:00https://galette.eu/site/post/2021/11/07/galette-0-9-5-2<p>This release brings a few bugfixes.</p> + +<ul> + <li>Update translations</li> + <li>Work on PHP 8.1 compatibility and tests improvements</li> + <li>Fix members list issue with titles column displayed</li> + <li>Fix members list ordering</li> + <li>Fix missing emails texts insertion</li> + <li>Drop duplicate check on saved searches</li> + <li>Fix some silent errors</li> + <li>Some data were missing checking passwords against personal data</li> + <li>Fix gateway timeout sending emails with SSL SMTP</li> +</ul> + +<p>See <a href="https://doc.galette.eu/en/master/changelog.html#v0952">Galette 0.9.5.2 changelog</a> for all details.</p> + +<p style="text-align: center;"><a href="https://download.tuxfamily.org/galette/galette-0.9.5.2.tar.bz2"><img src="https://img.shields.io/badge/0.9.5.2-Download_Galette-ffb619.svg?logo=php&amp;logoColor=white&amp;style=for-the-badge" alt="Download Galette 0.9.5.2" /></a></p> + +<p>Hope you will enjoy this release; happy Galette!</p>Johan C.This release brings a few bugfixes.Galette new release (0.9.5.1)!2021-10-23T07:30:00+02:002021-10-23T07:30:00+02:00https://galette.eu/site/post/2021/10/23/galette-0-9-5-1<p>Due to personal reasons, the previous major release has not been announced, but was available to download. Please see <a href="/site/post/2021/07/23/galette-0-9-5.html">Galette 0.9.5 news</a>.</p> + +<p>A very big thanks as well to everyone involved in this release, especially:</p> +<ul> + <li>Weblate contributors, many translations have been done,</li> + <li>community members who do tests during the development phases, many issues has been fixed,</li> + <li>…</li> +</ul> + +<p>This release brings a few new features and bugfixes as usual.</p> + +<ul> + <li>Mass change dynamic fields</li> + <li>Mass add contributions</li> + <li>Members can manage their children and create new ones</li> + <li>Fix overlapping menu in mobile</li> + <li>Fix advanced search with dynamic fields</li> + <li>Fix new user registration email</li> + <li>…</li> +</ul> + +<p>See <a href="https://doc.galette.eu/en/master/changelog.html#v0951">Galette 0.9.5.1 changelog</a> for all details.</p> + +<p style="text-align: center;"><a href="https://download.tuxfamily.org/galette/galette-0.9.5.1.tar.bz2"><img src="https://img.shields.io/badge/0.9.5.1-Download_Galette-ffb619.svg?logo=php&amp;logoColor=white&amp;style=for-the-badge" alt="Download Galette 0.9.5.1" /></a></p> + +<p>Hope you will enjoy this release; happy Galette!</p>Johan C.Due to personal reasons, the previous major release has not been announced, but was available to download. Please see Galette 0.9.5 news.Galette new major release (0.9.5)!2021-07-23T09:00:00+02:002021-07-23T09:00:00+02:00https://galette.eu/site/post/2021/07/23/galette-0-9-5<p>A very big thanks as well to everyone involved in this release, especially:</p> +<ul> + <li>Weblate contributors, many translations have been done,</li> + <li>community members who do tests during the development phases, many issues has been fixed,</li> + <li>…</li> +</ul> + +<p>This is a major release, which brings a few new features and bugfixes as usual, but this one also fix some security issues (CVE-2021-21319).</p> + +<ul> + <li>PDF and emails variables homogenisation; add variables for dynamic fields,</li> + <li>Add dynamic files on contributions and transactions</li> + <li>Rework database fields length</li> +</ul> + +<p>Some bugs have also been fixed; including PHP 8.0 issues among others. See <a href="https://doc.galette.eu/en/master/changelog.html#v095">Galette 0.9.5 changelog</a> for all details.</p> + +<p>Unfortunately, some required background changes (on dependency injection library) has made all plugins incompatible, and it is required to update them, see <a href="https://doc.galette.eu/en/master/plugins/">plugins documentation</a> ;-)</p> + +<p style="text-align: center;"><a href="https://download.tuxfamily.org/galette/galette-0.9.5.tar.bz2"><img src="https://img.shields.io/badge/0.9.5-Download_Galette-ffb619.svg?logo=php&amp;logoColor=white&amp;style=for-the-badge" alt="Download Galette 0.9.5" /></a></p> + +<p>Hope you will enjoy this release; happy Galette!</p>Johan C.A very big thanks as well to everyone involved in this release, especially: Weblate contributors, many translations have been done, community members who do tests during the development phases, many issues has been fixed, …Galette new bugfixes release (0.9.4.2)2020-11-01T11:07:03+01:002020-11-01T11:07:03+01:00https://galette.eu/site/post/2020/11/01/galette-0-9-4-2<p>A very big thank to everyone involved in this release :)</p> + +<p>This is a minor release, providing several bugfixes:</p> + +<ul> + <li>Issues on mailing instantiation, in core and plugins</li> + <li>Fix issues on mailings attachments</li> + <li>Post contribution script was called too early</li> + <li>Fix cards colors on new installations</li> + <li>First and last name were inverted in core PDF member card</li> + <li>Print logo was the one used, but not the one displayed in preferences</li> +</ul> + +<p>See <a href="https://doc.galette.eu/en/master/changelog.html#v0942">Galette 0.9.4.2 changelog</a> for all details.</p> + +<p style="text-align: center;"><a href="https://download.tuxfamily.org/galette/galette-0.9.4.2.tar.bz2"><img src="https://img.shields.io/badge/0.9.4.2-Download_Galette-ffb619.svg?logo=php&amp;logoColor=white&amp;style=for-the-badge" alt="Download Galette 0.9.4.2" /></a></p> + +<p>Hope you will enjoy this release; happy Galette!</p>Johan C.A very big thank to everyone involved in this release :)Galette new bugfixes release (0.9.4.1)2020-10-18T16:05:13+02:002020-10-18T16:05:13+02:00https://galette.eu/site/post/2020/10/18/galette-0-9-4-1<p>A very big thank to everyone involved in this release :)</p> + +<p>This is a minor release, providing several bugfixes and some background enhancements:</p> + +<ul> + <li>Translation improvements,</li> + <li>Several issues regarding reminders,</li> + <li>Several issues on booleans in dynamic fields and mass changes,</li> + <li>…</li> +</ul> + +<p>See <a href="https://doc.galette.eu/en/master/changelog.html#v0941">Galette 0.9.4.1 changelog</a> for all details.</p> + +<p>Code cleaning has continued, new checks on code quality has been set up; and a few issues has also been fixed on release archive.</p> + +<p style="text-align: center;"><a href="https://download.tuxfamily.org/galette/galette-0.9.4.1.tar.bz2"><img src="https://img.shields.io/badge/0.9.4.1-Download_Galette-ffb619.svg?logo=php&amp;logoColor=white&amp;style=for-the-badge" alt="Download Galette 0.9.4.1" /></a></p> + +<p>Hope you will enjoy this release; happy Galette!</p>Johan C.A very big thank to everyone involved in this release :)Galette new major release (0.9.4) - Community sponsored!2020-07-04T15:47:04+02:002020-07-04T15:47:04+02:00https://galette.eu/site/post/2020/07/04/galette-0-9-4<p>This release is dedicated to contributors of my new working station pool <strong>thank you very much</strong>!</p> + +<p><a data-fancybox="gallery" href="/site/assets/images/thanks.jpg"> + <img src="/site/assets/resized/thanks-800x183.jpg" alt="" srcset="/site/assets/resized/thanks-800x183.jpg 800w,/site/assets/resized/thanks-400x91.jpg 400w, /site/assets/images/thanks.jpg 3089w" sizes="100vw" /> +</a></p> + +<p>A very big thanks as well to everyone involved in this release, especially:</p> +<ul> + <li>community members who brings features/fix,</li> + <li>Weblate contributors, many translations have been done,</li> + <li>community members who do tests during the development phases, many issues has been fixed,</li> + <li><a href="https://apicy.fr">APiCy</a> association, which sponsored direct download links sent in mails,</li> + <li>…</li> +</ul> + +<p>This is a major release, which brings a few new features as usual:</p> + +<ul> + <li>Customizable password security level (complexity, blacklist, …)</li> +</ul> + +<p><a data-fancybox="gallery" href="/site/assets/images/screenshots/prefs_security.png" title="Password security preferences"> + <img src="/site/assets/resized/prefs_security-400x104.png" alt="Password security preferences" srcset="/site/assets/resized/prefs_security-400x104.png 400w, /site/assets/images/screenshots/prefs_security.png 757w" sizes="100vw" /> +</a></p> + +<ul> + <li>Choose and order visible fields on members list</li> +</ul> + +<p><a data-fancybox="gallery" href="/site/assets/images/screenshots/default_memberslist.png" title="Members list with default configuration"> + <img src="/site/assets/resized/default_memberslist-800x193.png" alt="Members list with default configuration" srcset="/site/assets/resized/default_memberslist-800x193.png 800w,/site/assets/resized/default_memberslist-400x96.png 400w, /site/assets/images/screenshots/default_memberslist.png 1079w" sizes="100vw" /> +</a></p> + +<p><a data-fancybox="gallery" href="/site/assets/images/screenshots/custom_memberslist.png" title="Members list with custom configuration"> + <img src="/site/assets/resized/custom_memberslist-800x193.png" alt="Members list with custom configuration" srcset="/site/assets/resized/custom_memberslist-800x193.png 800w,/site/assets/resized/custom_memberslist-400x96.png 400w, /site/assets/images/screenshots/custom_memberslist.png 1079w" sizes="100vw" /> +</a></p> + +<ul> + <li>Support of RTL languages in PDF</li> +</ul> + +<p><a data-fancybox="gallery" href="/site/assets/images/screenshots/rtl_pdf.png" title="RTL support in produced PDF"> + <img src="/site/assets/resized/rtl_pdf-800x186.png" alt="RTL support in produced PDF" srcset="/site/assets/resized/rtl_pdf-800x186.png 800w,/site/assets/resized/rtl_pdf-400x93.png 400w, /site/assets/images/screenshots/rtl_pdf.png 1545w" sizes="100vw" /> +</a></p> + +<p>And also:</p> + +<ul> + <li>CSV imports now handles dynamic fields and already encrypted passwords</li> + <li>Send invoice/receipt or membercard direct download links in emails</li> + <li>Offer last months when using beginning of membership date</li> + <li>Members can print their own invoices/receipts</li> + <li>Possibility to use member’s deadline instead of year in PDF cards</li> +</ul> + +<p>Some bugs have also been fixed; including PHP 7.4 and CSV import issues among others. See <a href="https://doc.galette.eu/en/master/changelog.html#v094">Galette 0.9.4 changelog</a> for all details.</p> + +<p>A big work has been done under the hood; the code has been cleaned and reorganized a bit, unit tests has been added and more work has been done on code quality.</p> + +<p>All official plugins, as well as documentation can now be <a href="https://hosted.weblate.org/projects/galette">translated</a> in the same languages as Galette itself! Setting up all that was a big work, but even if this has been done very recently, translations have already started :-)</p> + +<p>Most of the plugins have also been updated, please refer to <a href="https://doc.galette.eu/en/master/plugins/">plugins documentation</a> to know more ;-)</p> + +<p style="text-align: center;"><a href="https://download.tuxfamily.org/galette/galette-0.9.4.tar.bz2"><img src="https://img.shields.io/badge/0.9.4-Download_Galette-ffb619.svg?logo=php&amp;logoColor=white&amp;style=for-the-badge" alt="Download Galette 0.9.4" /></a></p> + +<p>Hope you will enjoy this release; happy Galette!</p>Johan C.This release is dedicated to contributors of my new working station pool thank you very much!New website for Galette!2020-05-28T19:14:04+02:002020-05-28T19:14:04+02:00https://galette.eu/site/post/2020/05/28/new-website<p>We are proud to announce the brand new Galette website!</p> + +<p>It’s been a while since the old one did not receive any real update, and it has several issues on localization (for example, menu was no longer translated into english).</p> + +<p>I’ve decided to make use of a vacation week to work on that. Old website was using <a href="https://dotclear.org">Dotclear</a>, we’ve switched to <a href="https://jekyllrb.com">Jekyll</a> now. All source code is <a href="https://git.tuxfamily.org/galette/website.git">publicly available</a> (a <a href="https://github.com/galette/website">mirror is available on GitHub</a> as well). Pages and posts are licensed under the terms of the <a href="https://creativecommons.org/licenses/by-sa/4.0">Creative Commons CC-BY-SA 4.0 license</a> and the “source code” under the terms of the <a href="https://www.gnu.org/licenses/quick-guide-gplv3.en.html">GPL version 3 license</a>.</p> + +<p>All posts have just been migrated (with a few fixes sometimes), and all pages has been entirely rewritten. I had to deal with some internationalization issues, but I guess I’ve been able to address them all… Please also note that new website has been built “mobile first” in mind; therefore navigation on mobile devices should be better than it was.</p> + +<p>In the end, I hope I’ll be able to use a translation platform to get the website translated in other languages; it seems Weblate does not support markdown/html contents yet; I’ll have to investigate a bit.</p> + +<p>If you find errors, <a href="https://bugs.galette.eu/projects/website">please open an issue</a>. Of course, you can also provide a git patch or open a pull request on GitHub :-)</p> + +<p>I’d like to thanks “GruiicK” on <a href="/site/contact/#irc">IRC</a>/<a href="/site/contact/#matrix">Matrix</a> for his precious help (as usual!) reviewing this new website, and also to “Hiob”!</p> + +<p>Happy Galette!</p>Johan C.We are proud to announce the brand new Galette website! \ No newline at end of file -- 2.39.2