summaryrefslogtreecommitdiffstats
path: root/tests/BandTest.php
diff options
context:
space:
mode:
authorAndreaChirulescu <andrea.chirulescu@gmail.com>2021-04-18 20:31:38 +0200
committerAndreaChirulescu <andrea.chirulescu@gmail.com>2021-04-18 20:31:38 +0200
commit106ca5e5247d542b62efa9034ad2d0427cb6fc5c (patch)
tree02e655a92c252f5f50286725184464a35c370e0a /tests/BandTest.php
parentd4af42336c745bb743560370bbbfc39c350ad51c (diff)
parenta851dd35b8ead5e4688062ff0c6e94d83133b006 (diff)
downloadgigologadmin-106ca5e5247d542b62efa9034ad2d0427cb6fc5c.tar.gz
gigologadmin-106ca5e5247d542b62efa9034ad2d0427cb6fc5c.tar.bz2
gigologadmin-106ca5e5247d542b62efa9034ad2d0427cb6fc5c.zip
Merge branch 'dev' of https://code.volse.net/wordpress/plugins/gigologadmin.git into andreaschanges
Diffstat (limited to 'tests/BandTest.php')
-rw-r--r--tests/BandTest.php30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/BandTest.php b/tests/BandTest.php
new file mode 100644
index 0000000..d3feb51
--- /dev/null
+++ b/tests/BandTest.php
@@ -0,0 +1,30 @@
+<?php
+// SPDX-FileCopyrightText: 2021 Andrea Chirulescu <andrea.chirulescu@gmail.com>
+// SPDX-FileCopyrightText: 2021 Harald Eilertsen <haraldei@anduin.net>
+//
+// SPDX-License-Identifier: AGPL-3.0-or-later
+
+declare(strict_types=1);
+
+require __DIR__ . '/../includes/band.php';
+
+final class BandTest extends WP_UnitTestCase
+{
+ public function testCreatingBandWithName() : void
+ {
+ $count = count(GiglogAdmin_Band::all_bands());
+
+ $band = GiglogAdmin_Band::create("The Flamboyant Blasphemers");
+
+ $this->assertEquals("The Flamboyant Blasphemers", $band->bandname());
+ $this->assertEquals($count + 1, count(GiglogAdmin_Band::all_bands()));
+ }
+
+ public function testCreateExistingBand() : void
+ {
+ $band1 = GiglogAdmin_Band::create("The Flamboyant Blasphemers");
+ $band2 = GiglogAdmin_Band::create("The Flamboyant Blasphemers");
+
+ $this->assertEquals($band1->id(), $band2->id());
+ }
+}