forked from baserproject/basercms
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BcAbstractDetector::find() ユニットテスト (baserproject#3780)
Co-authored-by: Đỗ Văn Hùng <[email protected]>
- Loading branch information
1 parent
bf59546
commit 1155b06
Showing
2 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
plugins/baser-core/tests/TestCase/Utility/BcAbstractDetectorTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
<?php | ||
/** | ||
* baserCMS : Based Website Development Project <https://basercms.net> | ||
* Copyright (c) NPO baser foundation <https://baserfoundation.org/> | ||
* | ||
* @copyright Copyright (c) NPO baser foundation | ||
* @link https://basercms.net baserCMS Project | ||
* @since 5.0.0 | ||
* @license https://basercms.net/license/index.html MIT License | ||
*/ | ||
|
||
namespace BaserCore\Test\TestCase\Utility; | ||
|
||
use BaserCore\TestSuite\BcTestCase; | ||
use BaserCore\Utility\BcAgent; | ||
use Cake\Core\Configure; | ||
|
||
/** | ||
* Class BcAbstractDetector | ||
* | ||
*/ | ||
class BcAbstractDetectorTest extends BcTestCase | ||
{ | ||
|
||
/** | ||
* set up | ||
*/ | ||
public function setUp(): void | ||
{ | ||
parent::setUp(); | ||
} | ||
|
||
/** | ||
* tearDown | ||
* | ||
* @return void | ||
*/ | ||
public function tearDown(): void | ||
{ | ||
parent::tearDown(); | ||
} | ||
|
||
/** | ||
* test find | ||
*/ | ||
public function testFind() | ||
{ | ||
Configure::write("BcApp.smartphone", true); | ||
|
||
//Configureにnameがある場合、 | ||
$rs = BcAgent::find('smartphone'); | ||
$this->assertEquals('smartphone', $rs->name); | ||
$this->assertEquals('device', $rs->type); | ||
|
||
//Configureにnameがない場合、 | ||
$this->assertNull(BcAgent::find('test')); | ||
} | ||
|
||
/** | ||
* test findAll | ||
*/ | ||
public function testFindAll() | ||
{ | ||
$this->markTestIncomplete('このテストは、まだ実装されていません。'); | ||
} | ||
|
||
/** | ||
* test findCurrent | ||
*/ | ||
public function testFindCurrent() | ||
{ | ||
$this->markTestIncomplete('このテストは、まだ実装されていません。'); | ||
} | ||
} |