diff options
author | AndreaChirulescu <andrea.chirulescu@gmail.com> | 2021-09-04 17:28:26 +0200 |
---|---|---|
committer | AndreaChirulescu <andrea.chirulescu@gmail.com> | 2021-09-04 17:28:26 +0200 |
commit | b92a2fc89ee23d20ac157fdf18e20861e6bd4c32 (patch) | |
tree | 9e998deb9a55df4b14a270cf78b097cd08753cf1 /tests/BandTest.php | |
parent | a479645ff6b092f72fa0add3dda6708214022200 (diff) | |
parent | 74fda7b89101ad47b77b486f4e38792db473cb00 (diff) | |
download | gigologadmin-b92a2fc89ee23d20ac157fdf18e20861e6bd4c32.tar.gz gigologadmin-b92a2fc89ee23d20ac157fdf18e20861e6bd4c32.tar.bz2 gigologadmin-b92a2fc89ee23d20ac157fdf18e20861e6bd4c32.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.php | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/tests/BandTest.php b/tests/BandTest.php deleted file mode 100644 index e4fccbe..0000000 --- a/tests/BandTest.php +++ /dev/null @@ -1,69 +0,0 @@ -<?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 -{ - /* This function runs _once_ before all the test cases. - * - * Use it to set up a common state that all test cases can - * use - */ - static function wpSetUpBeforeClass() : void - { - GiglogAdmin_Band::create("The Flamboyant Blasphemers"); - } - - public function testCreatingBandWithName() : void - { - $count = count(GiglogAdmin_Band::all_bands()); - - $band = GiglogAdmin_Band::create("Tullerusk"); - - $this->assertEquals("Tullerusk", $band->bandname()); - $this->assertEquals($count + 1, count(GiglogAdmin_Band::all_bands())); - } - - public function testCreateExistingBand() : void - { - $count = count(GiglogAdmin_Band::all_bands()); - - $existing_band = GiglogAdmin_Band::find("The Flamboyant Blasphemers", "NO"); - $new_band = GiglogAdmin_Band::create("The Flamboyant Blasphemers"); - - $this->assertEquals($count, count(GiglogAdmin_Band::all_bands())); - $this->assertEquals($existing_band->id(), $new_band->id()); - $this->assertEquals($existing_band->bandname(), $new_band->bandname()); - } - - public function testCreateBandsWithSameNameInDifferentCountry() : void - { - $existing_band = GiglogAdmin_Band::find("The Flamboyant Blasphemers", "NO"); - $new_band = GiglogAdmin_Band::create("The Flamboyant Blasphemers", "RO"); - - $this->assertNotEquals($existing_band->id(), $new_band->id()); - } - - public function testFindExistingBandReturnsObject() : void - { - $found = GiglogAdmin_Band::find("The Flamboyant Blasphemers", "NO"); - - $this->assertNotNull($found); - $this->assertEquals("The Flamboyant Blasphemers", $found->bandname()); - } - - public function testFindNonExistingBandReturnsNULL() : void - { - // 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); - } -} |