diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2021-04-16 12:03:32 +0200 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2021-04-16 12:03:32 +0200 |
commit | 3025047ed4a8ee805bbf59f27c58146490cf885d (patch) | |
tree | cc528f535b3f09488b56718e7d0d304857932ee9 | |
parent | 01944ece67dc4f7b691a0414e10f42e97e1dba1b (diff) | |
download | gigologadmin-3025047ed4a8ee805bbf59f27c58146490cf885d.tar.gz gigologadmin-3025047ed4a8ee805bbf59f27c58146490cf885d.tar.bz2 gigologadmin-3025047ed4a8ee805bbf59f27c58146490cf885d.zip |
Add a few more tests for GoglogAdmin_Band class.
Sidenote: UK is not included in the country list. Did the brexit
everything?
-rw-r--r-- | tests/BandTest.php | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/BandTest.php b/tests/BandTest.php index d3feb51..98aa331 100644 --- a/tests/BandTest.php +++ b/tests/BandTest.php @@ -27,4 +27,32 @@ final class BandTest extends WP_UnitTestCase $this->assertEquals($band1->id(), $band2->id()); } + + public function testCreateBandsWithSameNameInDifferentCountry() : void + { + $band1 = GiglogAdmin_Band::create("The Flamboyant Blasphemers", "RO"); + $band2 = GiglogAdmin_Band::create("The Flamboyant Blasphemers", "NO"); + + $this->assertNotEquals($band1->id(), $band2->id()); + } + + public function testFindExistingBandReturnsObject() : void + { + $created = GiglogAdmin_Band::create("The Flamboyant Blasphemers", "RO"); + $found = GiglogAdmin_Band::find("The Flamboyant Blasphemers", "RO"); + + $this->assertNotNull($found); + $this->assertEquals($created->id(), $found->id()); + } + + public function testFindNonExistingBandReturnsNULL() : void + { + $band1 = GiglogAdmin_Band::create("The Flamboyant Blasphemers", "RO"); + + // Nice, UK isn't in the country list, so let's move Venom to Azerbajan + // for now... + $found = GiglogAdmin_Band::find("Venom", "AZ"); + + $this->assertNull($found); + } } |