]> git.agnieray.net Git - galette.git/commitdiff
Add discord
authorJohan Cwiklinski <johan@x-tnd.be>
Mon, 15 Jan 2024 19:55:32 +0000 (20:55 +0100)
committerJohan Cwiklinski <johan@x-tnd.be>
Mon, 15 Jan 2024 20:24:12 +0000 (21:24 +0100)
refs #1760

galette/lib/Galette/Entity/Social.php
tests/Galette/Core/tests/units/Preferences.php
tests/Galette/Entity/tests/units/Social.php

index 7556b130825a28f59cc7f63735aed1721e6ad926..df913fefaf7e1501e2ea0dbc71e08b94612c4a9b 100644 (file)
@@ -7,7 +7,7 @@
  *
  * PHP version 5
  *
- * Copyright © 2021-2023 The Galette Team
+ * Copyright © 2021-2024 The Galette Team
  *
  * This file is part of Galette (http://galette.tuxfamily.org).
  *
@@ -28,7 +28,7 @@
  * @package   Galette
  *
  * @author    Johan Cwiklinski <johan@x-tnd.be>
- * @copyright 2021-2023 The Galette Team
+ * @copyright 2021-2024 The Galette Team
  * @license   http://www.gnu.org/licenses/gpl-3.0.html GPL License 3.0 or (at your option) any later version
  * @link      http://galette.tuxfamily.org
  * @since     Available since 0.9.6dev - 2021-10-23
@@ -51,7 +51,7 @@ use Analog\Analog;
  * @name      Social
  * @package   Galette
  * @author    Johan Cwiklinski <johan@x-tnd.be>
- * @copyright 2021-2023 The Galette Team
+ * @copyright 2021-2024 The Galette Team
  * @license   http://www.gnu.org/licenses/gpl-3.0.html GPL License 3.0 or (at your option) any later version
  * @link      http://galette.tuxfamily.org
  * @since     Available since 0.9.6dev - 2021-10-23
@@ -73,6 +73,7 @@ class Social
     public const ICQ = 'icq';
     public const WEBSITE = 'website';
     public const BLOG = 'blog';
+    public const DISCORD = 'discord';
 
     /** @var Db */
     private $zdb;
@@ -367,7 +368,8 @@ class Social
                 self::JABBER => _T('Jabber'),
                 self::ICQ => _T('ICQ'),
                 self::WEBSITE => _T('Website'),
-                self::BLOG => _T('Blog')
+                self::BLOG => _T('Blog'),
+                self::DISCORD => _T('Discord')
             ];
         } else {
             $systypes = [
@@ -379,7 +381,8 @@ class Social
                 self::JABBER => 'jabber',
                 self::ICQ => 'icq',
                 self::WEBSITE => 'website',
-                self::BLOG => 'blog'
+                self::BLOG => 'blog',
+                self::DISCORD => 'discord'
             ];
         }
         return $systypes;
index 43196c286c15dae6fc51d1bc86eeb8d6bbc8021a..afe9f5b63a989eb6c09ab0fb68c50b22e0939117 100644 (file)
@@ -7,7 +7,7 @@
  *
  * PHP version 5
  *
- * Copyright © 2013-2023 The Galette Team
+ * Copyright © 2013-2024 The Galette Team
  *
  * This file is part of Galette (http://galette.tuxfamily.org).
  *
@@ -28,7 +28,7 @@
  * @package   GaletteTests
  *
  * @author    Johan Cwiklinski <johan@x-tnd.be>
- * @copyright 2013-2023 The Galette Team
+ * @copyright 2013-2024 The Galette Team
  * @license   http://www.gnu.org/licenses/gpl-3.0.html GPL License 3.0 or (at your option) any later version
  * @link      http://galette.tuxfamily.org
  * @since     2013-10-19
@@ -45,7 +45,7 @@ use PHPUnit\Framework\TestCase;
  * @name      Preferences
  * @package   GaletteTests
  * @author    Johan Cwiklinski <johan@x-tnd.be>
- * @copyright 2013-2023 The Galette Team
+ * @copyright 2013-2024 The Galette Team
  * @license   http://www.gnu.org/licenses/gpl-3.0.html GPL License 3.0 or (at your option) any later version
  * @link      http://galette.tuxfamily.org
  * @since     2013-01-13
@@ -613,7 +613,7 @@ class Preferences extends TestCase
         $legend = $this->preferences->getLegend();
         $this->assertCount(2, $legend);
         $this->assertCount(8, $legend['main']['patterns']);
-        $this->assertCount(9, $legend['socials']['patterns']);
+        $this->assertCount(10, $legend['socials']['patterns']);
         $this->assertSame(
             [
             'title' => __('Mastodon'),
@@ -633,7 +633,7 @@ class Preferences extends TestCase
 
         $legend = $this->preferences->getLegend();
         $this->assertCount(2, $legend);
-        $this->assertCount(10, $legend['socials']['patterns']);
+        $this->assertCount(11, $legend['socials']['patterns']);
         $this->assertTrue(isset($legend['socials']['patterns']['asso_social_mynewtype']));
         $this->assertSame(
             [
index ffe387842a6834a3b035e04e04dc4c516debc13f..eed5faef0c5cff3e578ed009abd3f4a038b8c3e2 100644 (file)
@@ -7,7 +7,7 @@
  *
  * PHP version 5
  *
- * Copyright © 2021-2023 The Galette Team
+ * Copyright © 2021-2024 The Galette Team
  *
  * This file is part of Galette (http://galette.tuxfamily.org).
  *
@@ -28,7 +28,7 @@
  * @package   GaletteTests
  *
  * @author    Johan Cwiklinski <johan@x-tnd.be>
- * @copyright 2019-2023 The Galette Team
+ * @copyright 2019-2024 The Galette Team
  * @license   http://www.gnu.org/licenses/gpl-3.0.html GPL License 3.0 or (at your option) any later version
  * @link      http://galette.tuxfamily.org
  * @since     2021-10-26
@@ -45,7 +45,7 @@ use Galette\GaletteTestCase;
  * @name      Social
  * @package   GaletteTests
  * @author    Johan Cwiklinski <johan@x-tnd.be>
- * @copyright 2021-2023 The Galette Team
+ * @copyright 2021-2024 The Galette Team
  * @license   http://www.gnu.org/licenses/gpl-3.0.html GPL License 3.0 or (at your option) any later version
  * @link      http://galette.tuxfamily.org
  * @since     2021-10-26
@@ -121,9 +121,9 @@ class Social extends GaletteTestCase
     public function testGetSystemTypes()
     {
         $social = new \Galette\Entity\Social($this->zdb);
-        $this->assertCount(9, $social->getSystemTypes());
+        $this->assertCount(10, $social->getSystemTypes());
         $this->assertSame($social->getSystemTypes(true), $social->getSystemTypes());
-        $this->assertCount(9, $social->getSystemTypes(false));
+        $this->assertCount(10, $social->getSystemTypes(false));
 
         $this->assertSame('Twitter', $social->getSystemType(\Galette\Entity\Social::TWITTER));
         $this->assertSame('twitter', $social->getSystemType(\Galette\Entity\Social::TWITTER, false));