[travis] Updated an expected value in a service test of Travis PHP version badge (#1526)

* Updated an expected value in a service test of Travis PHP version badge

* Use the isPhpVersionReduction in a service tests of Travis PHP version
This commit is contained in:
Marcin Mielnicki
2018-02-27 04:11:50 +01:00
committed by Danial
parent 6b76a6ef24
commit ff24bf3ff8

View File

@@ -1,21 +1,23 @@
'use strict';
const Joi = require('joi');
const ServiceTester = require('./runner/service-tester');
const {isPhpVersionReduction} = require('./helpers/validators');
const t = new ServiceTester({ id: 'travis', title: 'PHP version from .travis.yml' });
module.exports = t;
t.create('gets the package version of symfony')
.get('/php-v/symfony/symfony.json')
.expectJSON({ name: 'PHP', value: '>= 7.1' });
.expectJSONTypes(Joi.object().keys({ name: 'PHP', value: isPhpVersionReduction }));
t.create('gets the package version of symfony 2.8')
.get('/php-v/symfony/symfony/2.8.json')
.expectJSON({ name: 'PHP', value: '>= 5.4, HHVM' });
.expectJSONTypes(Joi.object().keys({ name: 'PHP', value: isPhpVersionReduction }));
t.create('gets the package version of yii')
.get('/php-v/yiisoft/yii.json')
.expectJSON({ name: 'PHP', value: '5.3 - 7.1, HHVM' });
.expectJSONTypes(Joi.object().keys({ name: 'PHP', value: isPhpVersionReduction }));
t.create('invalid package name')
.get('/php-v/frodo/is-not-a-package.json')