Skip to content

Commit 2f2c50d

Browse files
committed
test: cover active_call and battery/keyboard
1 parent ba83921 commit 2f2c50d

4 files changed

Lines changed: 25 additions & 0 deletions

File tree

‎test/Api/FingerprintApiTest.php‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1607,6 +1607,8 @@ private function assertEvent(Event $event, \stdClass $actual): void
16071607
$this->assertEquals($actualProximity->precision_radius, $proximity->getPrecisionRadius());
16081608
$this->assertEquals($actualProximity->confidence, $proximity->getConfidence());
16091609

1610+
$this->assertEquals($actual->active_call, $event->getActiveCall());
1611+
16101612
$this->assertEquals(BotResult::NOT_DETECTED, $event->getBot());
16111613
$this->assertEquals(null, $event->getBotType());
16121614
$this->assertEquals(null, $event->getBotInfo());
@@ -1637,6 +1639,10 @@ private function assertEvent(Event $event, \stdClass $actual): void
16371639
$this->assertEquals('db3c1462576a399a03ae93d0ab9eb5c4', $rawDeviceAttributes->getCanvas()->getGeometry());
16381640
$this->assertEquals('24', $rawDeviceAttributes->getColorDepth());
16391641
$this->assertTrue($rawDeviceAttributes->getCookiesEnabled());
1642+
$this->assertEquals(80, $rawDeviceAttributes->getBatteryLevel());
1643+
$this->assertTrue($rawDeviceAttributes->getBatteryCharging());
1644+
$this->assertTrue($rawDeviceAttributes->getBatteryLowPowerMode());
1645+
$this->assertEquals('691e3845c85c202a1514b6fd7ef17065', $rawDeviceAttributes->getKeyboardLayoutHash());
16401646

16411647
$labels = $event->getLabels();
16421648
$actualLabels = $actual->labels;

‎test/Model/EventAllPropertiesTest.php‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,13 @@ public function testSetProximity(): void
407407
$this->assertSame($proximity, $event->getProximity());
408408
}
409409

410+
public function testSetActiveCall(): void
411+
{
412+
$event = new Event(['event_id' => 'e', 'timestamp' => 1]);
413+
$event->setActiveCall(true);
414+
$this->assertTrue($event->getActiveCall());
415+
}
416+
410417
public function testSetTamperingConfidence(): void
411418
{
412419
$event = new Event(['event_id' => 'e', 'timestamp' => 1]);

‎test/Model/RawDeviceAttributesTest.php‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,12 @@ public function testAllGettersAndSetters(): void
122122

123123
$model->setBatteryLowPowerMode(false);
124124
$this->assertFalse($model->getBatteryLowPowerMode());
125+
126+
$model->setBatteryCharging(true);
127+
$this->assertTrue($model->getBatteryCharging());
128+
129+
$model->setKeyboardLayoutHash('691e3845c85c202a1514b6fd7ef17065');
130+
$this->assertSame('691e3845c85c202a1514b6fd7ef17065', $model->getKeyboardLayoutHash());
125131
}
126132

127133
public function testDeviceMemoryLowerBoundValidation(): void
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"error": {
3+
"code": "failed",
4+
"message": "gateway timeout"
5+
}
6+
}

0 commit comments

Comments
 (0)