Skip to content

Commit

Permalink
Merge pull request #3962 from thangnnmd/unitTest_BcAbstractDetector_c…
Browse files Browse the repository at this point in the history
…onstruct

BcAbstractDetector::construct
  • Loading branch information
HungDV2022 authored Nov 7, 2024
2 parents 0c7e0c1 + dd38f64 commit 868499a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions plugins/baser-core/src/Utility/BcAbstractDetector.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ abstract class BcAbstractDetector
* @param array $config 設定の配列
* @checked
* @noTodo
* @unitTest
*/
public function __construct($name, array $config)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

0 comments on commit 868499a

Please sign in to comment.