Skip to content

Commit

Permalink
ユニットテスト調整 (#3038)
Browse files Browse the repository at this point in the history
Co-authored-by: Đỗ Văn Hùng <[email protected]>
  • Loading branch information
HungDV2022 and dovanhung authored Jan 17, 2024
1 parent 9469bc3 commit 488f7ec
Show file tree
Hide file tree
Showing 57 changed files with 468 additions and 1,006 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ public function isAsset(ServerRequestInterface $request)
* @return bool
* @checked
* @noTodo
* @unitTest
*/
public function isInstall(ServerRequestInterface $request)
{
Expand Down
1 change: 0 additions & 1 deletion plugins/baser-core/src/Model/Behavior/BcUploadBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,6 @@ public function beforeDelete(EventInterface $event, EntityInterface $entity, \Ar
* @return mixed false|array
* @checked
* @noTodo
* @unitTest
*/
public function saveTmpFiles($data, $tmpId)
{
Expand Down
2 changes: 0 additions & 2 deletions plugins/baser-core/src/TestSuite/BcTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,6 @@ protected function getPrivateProperty(object $class, string $property)
*
* @param $events
* @checked
* @unitTest
* @noTodo
*/
public function attachEvent($events)
Expand All @@ -346,7 +345,6 @@ public function attachEvent($events)
/**
* イベントをリセットする
* @checked
* @unitTest
* @noTodo
*/
public function resetEvent()
Expand Down
1 change: 0 additions & 1 deletion plugins/baser-core/src/Utility/BcComposer.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ public static function installComposer()
* @return array
* @checked
* @noTodo
* @checked
*/
public static function require(string $package, string $version)
{
Expand Down
2 changes: 0 additions & 2 deletions plugins/baser-core/src/Utility/BcUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -1577,7 +1577,6 @@ public static function fgetcsvReg(&$handle, $length = null, $d = ',', $e = '"')
* @return array
* @checked
* @noTodo
* @unitTest
*/
public static function offEvent(EventManagerInterface $eventManager, string $eventKey)
{
Expand All @@ -1597,7 +1596,6 @@ public static function offEvent(EventManagerInterface $eventManager, string $eve
* @param EventListenerInterface[] $eventListeners
* @checked
* @noTodo
* @unitTest
*/
public static function onEvent(EventManagerInterface $eventManager, string $eventKey, array $eventListeners)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ public function testDelete()
{
$this->enableSecurityToken();
$this->enableCsrfToken();
$this->post('/baser/admin/baser-core/users/delete/1');
$this->post('/baser/admin/baser-core/users/delete/2');
$this->assertResponseSuccess();
$this->assertRedirect([
'plugin' => 'BaserCore',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function setUp(): void
public function testInitialize()
{
$controller = new BcAdminApiController($this->getRequest());
$this->assertTrue(isset($controller->Authentication));
$this->assertNotNull($controller->Authentication);
$this->assertFalse($controller->FormProtection->getConfig('validate'));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ public function testInitialize(){
$request = $this->getRequest('/baser/api/admin/baser-core/users/');
$request = $this->loginAdmin($request);
$usersController = new UsersController($request);

$this->assertEquals($usersController->Authentication->unauthenticatedActions, ['login']);
$this->assertEquals($usersController->Authentication->getUnauthenticatedActions(), ['login']);
}

public function testLoginAndRefreshToken()
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public function tearDown(): void
*/
public function testDispatchLayerEvent()
{
$this->markTestIncomplete('こちらのテストはまだ未確認です');
$listener = $this->getMockBuilder(BcControllerEventListener::class)
->onlyMethods(['implementedEvents'])
->addMethods(['testTest'])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ public static function isAssetDataProvider()
*/
public function testIsInstall($expect, $url)
{
$this->markTestIncomplete('こちらのテストはまだ未確認です');
Configure::write('BcRequest.isInstalled', false);
$this->assertEquals($expect, $this->BcRequestFilterMiddleware->isInstall($this->getRequest($url)));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ public function testAfterSave()
*/
public function testSaveTmpFiles()
{
$this->markTestIncomplete('こちらのテストはまだ未確認です');
touch($this->uploadedData['eyecatch']['tmp_name']);
$entity = $this->BcUploadBehavior->saveTmpFiles($this->uploadedData, 1);
$tmpId = $this->BcUploadBehavior->BcFileUploader[$this->table->getAlias()]->tmpId;
Expand Down
Loading

0 comments on commit 488f7ec

Please sign in to comment.