diff --git a/Controller/BackendController.php b/Controller/BackendController.php index 99dff83..2ae840c 100755 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -58,7 +58,7 @@ final class BackendController extends Controller ->limit(1) ->execute(); - if ($board instanceof NullDashboardBoard) { + if ($board->id === 0) { /** @var \Modules\Dashboard\Models\DashboardBoard $board */ $board = DashboardBoardMapper::get()->where('id', 1)->execute(); } diff --git a/Models/DashboardBoard.php b/Models/DashboardBoard.php index a73fab0..deda64d 100755 --- a/Models/DashboardBoard.php +++ b/Models/DashboardBoard.php @@ -34,7 +34,7 @@ class DashboardBoard implements \JsonSerializable * @var int * @since 1.0.0 */ - protected int $id = 0; + public int $id = 0; /** * Title. @@ -58,7 +58,7 @@ class DashboardBoard implements \JsonSerializable * @var int * @since 1.0.0 */ - protected int $status = DashboardBoardStatus::ACTIVE; + public int $status = DashboardBoardStatus::ACTIVE; /** * Dashboard component. diff --git a/Models/DashboardComponent.php b/Models/DashboardComponent.php index 9bf7be3..4883498 100755 --- a/Models/DashboardComponent.php +++ b/Models/DashboardComponent.php @@ -30,7 +30,7 @@ class DashboardComponent implements \JsonSerializable * @var int * @since 1.0.0 */ - protected int $id = 0; + public int $id = 0; /** * Order. diff --git a/tests/Controller/ApiControllerTest.php b/tests/Controller/ApiControllerTest.php index 796ff99..e21175d 100755 --- a/tests/Controller/ApiControllerTest.php +++ b/tests/Controller/ApiControllerTest.php @@ -105,7 +105,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase $request->setData('title', 'Default Board'); $this->module->apiBoardCreate($request, $response); - self::assertGreaterThan(0, $response->get('')['response']->getId()); + self::assertGreaterThan(0, $response->get('')['response']->id); } /** @@ -139,7 +139,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase $request->setData('module', 'TestModule'); $this->module->apiComponentCreate($request, $response); - self::assertGreaterThan(0, $response->get('')['response']->getId()); + self::assertGreaterThan(0, $response->get('')['response']->id); } /** diff --git a/tests/Models/DashboardBoardTest.php b/tests/Models/DashboardBoardTest.php index a00dae9..35b0b6a 100755 --- a/tests/Models/DashboardBoardTest.php +++ b/tests/Models/DashboardBoardTest.php @@ -41,7 +41,7 @@ final class DashboardBoardTest extends \PHPUnit\Framework\TestCase */ public function testDefault() : void { - self::assertEquals(0, $this->board->getId()); + self::assertEquals(0, $this->board->id); self::assertEquals('', $this->board->title); self::assertEquals([], $this->board->getComponents()); self::assertEquals(DashboardBoardStatus::ACTIVE, $this->board->getStatus()); diff --git a/tests/Models/DashboardComponentTest.php b/tests/Models/DashboardComponentTest.php index 3c1c4ae..48600db 100755 --- a/tests/Models/DashboardComponentTest.php +++ b/tests/Models/DashboardComponentTest.php @@ -37,7 +37,7 @@ final class DashboardComponentTest extends \PHPUnit\Framework\TestCase */ public function testDefault() : void { - self::assertEquals(0, $this->component->getId()); + self::assertEquals(0, $this->component->id); self::assertEquals(0, $this->component->order); self::assertEquals(0, $this->component->board); self::assertEquals('', $this->component->module); diff --git a/tests/Models/NullDashboardBoardTest.php b/tests/Models/NullDashboardBoardTest.php index 8edfde1..4f16e87 100755 --- a/tests/Models/NullDashboardBoardTest.php +++ b/tests/Models/NullDashboardBoardTest.php @@ -37,6 +37,6 @@ final class NullDashboardBoardTest extends \PHPUnit\Framework\TestCase public function testId() : void { $null = new NullDashboardBoard(2); - self::assertEquals(2, $null->getId()); + self::assertEquals(2, $null->id); } } diff --git a/tests/Models/NullDashboardComponentTest.php b/tests/Models/NullDashboardComponentTest.php index dcad9c9..d37046a 100755 --- a/tests/Models/NullDashboardComponentTest.php +++ b/tests/Models/NullDashboardComponentTest.php @@ -37,6 +37,6 @@ final class NullDashboardComponentTest extends \PHPUnit\Framework\TestCase public function testId() : void { $null = new NullDashboardComponent(2); - self::assertEquals(2, $null->getId()); + self::assertEquals(2, $null->id); } }