Skip to content

Commit

Permalink
add WidgetArea_getCount (#3385)
Browse files Browse the repository at this point in the history
Co-authored-by: thangnn <[email protected]>
  • Loading branch information
thangnnmd and thangnn authored Apr 29, 2024
1 parent 1bf6823 commit 38a27ed
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
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('こちらのテストはまだ未確認です');
}
}

0 comments on commit 38a27ed

Please sign in to comment.