summaryrefslogtreecommitdiffstats
path: root/tests/BandTest.php
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2021-04-15 22:22:40 +0200
committerHarald Eilertsen <haraldei@anduin.net>2021-04-15 22:22:40 +0200
commita851dd35b8ead5e4688062ff0c6e94d83133b006 (patch)
tree02e655a92c252f5f50286725184464a35c370e0a /tests/BandTest.php
parent7160aacdc83cfcef9ffd795cec7e9397bfbb3698 (diff)
downloadgigologadmin-a851dd35b8ead5e4688062ff0c6e94d83133b006.tar.gz
gigologadmin-a851dd35b8ead5e4688062ff0c6e94d83133b006.tar.bz2
gigologadmin-a851dd35b8ead5e4688062ff0c6e94d83133b006.zip
Refactor Band::create into Band::find and ::create
Not sure if it's a good idea to have `create` return an existing band. Will have to look at callsites to see if it should be renamed back or if the callsite should be changed.
Diffstat (limited to 'tests/BandTest.php')
-rw-r--r--tests/BandTest.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/BandTest.php b/tests/BandTest.php
index 764abe3..d3feb51 100644
--- a/tests/BandTest.php
+++ b/tests/BandTest.php
@@ -10,7 +10,7 @@ require __DIR__ . '/../includes/band.php';
final class BandTest extends WP_UnitTestCase
{
- public function testCreatingBandWithName(): void
+ public function testCreatingBandWithName() : void
{
$count = count(GiglogAdmin_Band::all_bands());
@@ -19,4 +19,12 @@ final class BandTest extends WP_UnitTestCase
$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());
+ }
}