diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2021-04-15 21:50:58 +0200 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2021-04-15 21:52:05 +0200 |
commit | 7160aacdc83cfcef9ffd795cec7e9397bfbb3698 (patch) | |
tree | 69e7ace6f3a689de2150a8bea16fe29b78753b3a /tests | |
parent | e59f12fd21af5489b8889aa4c3ab5a90a9b317a9 (diff) | |
download | gigologadmin-7160aacdc83cfcef9ffd795cec7e9397bfbb3698.tar.gz gigologadmin-7160aacdc83cfcef9ffd795cec7e9397bfbb3698.tar.bz2 gigologadmin-7160aacdc83cfcef9ffd795cec7e9397bfbb3698.zip |
Make Band::create return band object, not just id.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/BandTest.php | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/BandTest.php b/tests/BandTest.php new file mode 100644 index 0000000..764abe3 --- /dev/null +++ b/tests/BandTest.php @@ -0,0 +1,22 @@ +<?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())); + } +} |