diff --git a/plugins/baser-core/src/Utility/BcAbstractDetector.php b/plugins/baser-core/src/Utility/BcAbstractDetector.php index fb831f875b..d65a4da4d6 100644 --- a/plugins/baser-core/src/Utility/BcAbstractDetector.php +++ b/plugins/baser-core/src/Utility/BcAbstractDetector.php @@ -62,6 +62,7 @@ abstract class BcAbstractDetector * @param array $config 設定の配列 * @checked * @noTodo + * @unitTest */ public function __construct($name, array $config) { diff --git a/plugins/baser-core/tests/TestCase/Utility/BcAbstractDetectorTest.php b/plugins/baser-core/tests/TestCase/Utility/BcAbstractDetectorTest.php index f5ab3fac85..bca1600b6c 100644 --- a/plugins/baser-core/tests/TestCase/Utility/BcAbstractDetectorTest.php +++ b/plugins/baser-core/tests/TestCase/Utility/BcAbstractDetectorTest.php @@ -100,4 +100,24 @@ public static function findCurrentDataProvider(): array ['hoge', null], ]; } + + /** + * test __construct + */ + public function testConstruct() + { + $name = 'TestName'; + $config = [ + 'agents' => [ + 'iPhone', // Apple iPhone + 'iPod', // Apple iPod touch + 'Android', // 1.5+ Android + 'dream', // Pre 1.5 Android + ] + ]; + $instance = new BcAgent($name, $config); + $this->assertEquals('TestName', $instance->name); + $this->assertEquals($config['agents'][0], $instance->decisionKeys[0]); + $this->assertFalse($instance->sessionId); + } }