Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add WidgetArea_getCount #3385

Merged
merged 2 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions plugins/bc-widget-area/src/Model/Entity/WidgetArea.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ protected function _setWidgets($value)
* @return int
* @checked
* @noTodo
* @unitTest
*/
protected function _getCount()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php

namespace BcWidgetArea\Test\TestCase\Model\Entity;

use BaserCore\TestSuite\BcTestCase;
use BcWidgetArea\Model\Entity\WidgetArea;

class WidgetAreaTest extends BcTestCase
{
public function setUp(): void
{
parent::setUp();
$this->WidgetArea = $this->getTableLocator()->get('BcWidgetArea.WidgetAreas');
}

public function tearDown(): void
{
unset($this->WidgetArea);
parent::tearDown();
}

/**
* test _getCount
*/
public function test_getCount()
{
$widgetArea = new WidgetArea([
'widgets' => 'a:1:{i:0;a:1:{s:4:"test";a:2:{s:4:"sort";i:1;s:4:"name";s:4:"test";}}}',
]);
$getCount = $this->execPrivateMethod($widgetArea, '_getCount', []);
$this->assertEquals(1, $getCount);
}

/**
* test _getWidgetsArray
*/
public function test_getWidgetsArray()
{
$this->markTestIncomplete('こちらのテストはまだ未確認です');
}

/**
* test _setWidgets
*/
public function test_setWidgets()
{
$this->markTestIncomplete('こちらのテストはまだ未確認です');
}
}
Loading