-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathintegrationDeskphoneTest.php
More file actions
39 lines (33 loc) · 1.15 KB
/
integrationDeskphoneTest.php
File metadata and controls
39 lines (33 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
/**
* Integration tests for module Snom (Deskphone).
* Before executing this tests, make sure that const PHONE_IP has the value
* of a Snom phone connected to the same network as the machine were the
* tests are running.
*/
declare(strict_types=1);
include_once __DIR__ . '/stubs/GlobalStubs.php';
include_once __DIR__ . '/stubs/KernelStubs.php';
include_once __DIR__ . '/stubs/MessageStubs.php';
include_once __DIR__ . '/stubs/GlobalStubs.php';
use PHPUnit\Framework\TestCase;
const PHONE_IP = '10.110.10.100';
class IntegrationDeskphoneTest extends TestCase
{
protected $snomDeskphoneModuleId = "{6A66A16E-5525-10FE-72D4-772C9ADD8D45}";
protected function setUp(): void
{
IPS\Kernel::reset();
$file = __DIR__ . '/../library.json';
IPS\ModuleLoader::loadLibrary($file);
parent::setUp();
}
public function testPhoneIsReachable()
{
$deskphoneId = IPS_CreateInstance($this->snomDeskphoneModuleId);
IPS_SetProperty($deskphoneId, 'PhoneIP', PHONE_IP);
IPS_ApplyChanges($deskphoneId);
$expected = "IP " . PHONE_IP . " is reachable";
$this->assertEquals(SNMD_PingPhone($deskphoneId, PHONE_IP), $expected);
}
}