adapt device tests, fix gitlab ci script

Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
This commit is contained in:
Julien Veyssier 2019-10-20 17:47:39 +02:00
Родитель e2cfca7afc
Коммит de20e3714c
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4141FEE162030638
2 изменённых файлов: 23 добавлений и 3 удалений

Просмотреть файл

@ -43,7 +43,8 @@ test_nc17_sqlite:
- sudo -u www-data php /var/www/html/nextcloud/occ app:enable maps
- sudo -u www-data php /var/www/html/nextcloud/occ maintenance:mode --off
# check code with occ
- sudo -u www-data php /var/www/html/nextcloud/occ app:check-code maps
# disabled because it does not like type=>filesystem in info.xml
#- sudo -u www-data php /var/www/html/nextcloud/occ app:check-code maps
# check JS code
- jshint --verbose maps/js/script.js && echo "jshint OK" || echo "jshint has complaints"
- cd /var/www/html/nextcloud/apps/maps
@ -79,7 +80,7 @@ test_nc17_pgsql:
- sudo -u www-data php /var/www/html/nextcloud/occ app:enable maps
- sudo -u www-data php /var/www/html/nextcloud/occ maintenance:mode --off
# check code with occ
- sudo -u www-data php /var/www/html/nextcloud/occ app:check-code maps
#- sudo -u www-data php /var/www/html/nextcloud/occ app:check-code maps
# check JS code
- jshint --verbose maps/js/script.js && echo "jshint OK" || echo "jshint has complaints"
- cd /var/www/html/nextcloud/apps/maps
@ -114,7 +115,7 @@ test_nc17_mysql:
- sudo -u www-data php /var/www/html/nextcloud/occ app:enable maps
- sudo -u www-data php /var/www/html/nextcloud/occ maintenance:mode --off
# check code with occ
- sudo -u www-data php /var/www/html/nextcloud/occ app:check-code maps
#- sudo -u www-data php /var/www/html/nextcloud/occ app:check-code maps
# check JS code
- jshint --verbose maps/js/script.js && echo "jshint OK" || echo "jshint has complaints"
- cd /var/www/html/nextcloud/apps/maps

Просмотреть файл

@ -198,6 +198,25 @@ class DevicesControllerTest extends \PHPUnit\Framework\TestCase {
$this->assertEquals(true, count($data) === 1);
$this->assertEquals(true, $data[0]['timestamp'] >= $ts);
// test missing values
$resp = $this->devicesController->addDevicePoint(1.1, 2.2, 12346, 'testDevice', null, null, null);
$status = $resp->getStatus();
$this->assertEquals(200, $status);
$resp = $this->devicesController->addDevicePoint(1.1, 2.2, 12347, 'testDevice', '', '', '');
$status = $resp->getStatus();
$this->assertEquals(200, $status);
$resp = $this->devicesController->addDevicePoint(1.1, 2.2, 12348, 'testDevice', 'a', 'b', 'c');
$status = $resp->getStatus();
$this->assertEquals(200, $status);
$resp = $this->devicesController->getDevicePoints($deviceId);
$status = $resp->getStatus();
$this->assertEquals(200, $status);
$data = $resp->getData();
$this->assertEquals(true, count($data) === 4);
// invalid values
$resp = $this->devicesController->addDevicePoint('aaa', 2.2, 12345, 'testDevice', 1000, 99, 50);
$status = $resp->getStatus();