From 7160aacdc83cfcef9ffd795cec7e9397bfbb3698 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Thu, 15 Apr 2021 21:50:58 +0200 Subject: Make Band::create return band object, not just id. --- tests/BandTest.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 tests/BandTest.php (limited to 'tests') 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 @@ + +// SPDX-FileCopyrightText: 2021 Harald Eilertsen +// +// 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())); + } +} -- cgit v1.2.3