Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updat the phpunit verison for PHP >=7.1. #117

Merged
merged 3 commits into from
Sep 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ language: php
sudo: false

php:
- 7.1
- 7.2
- 7.3

matrix:
# Don't wait for the allowed failures to build.
Expand All @@ -17,5 +17,5 @@ cache:
script:
- composer install
- ./vendor/bin/phpcs --report=checkstyle
- phpunit --coverage-text
- ./vendor/bin/phpunit --coverage-text

8 changes: 4 additions & 4 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

## Requirements

* PHP 7.1+
* php7.1-sqlite3
* php7.1-pdo_sqlite
* PHP 7.2+
* php7.2-sqlite3
* php7.2-pdo_sqlite


## Installation
Expand All @@ -24,7 +24,7 @@ wget http://larowlan.github.io/tl/tl.phar

```bash
# Get the phar
curl -O http://larowlan.github.io/tl/tl.phar
curl -O https://github.com/larowlan/tl/raw/master/tl.phar
```

## Setup
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"herrera-io/phar-update": "^2.0",
"stecman/symfony-console-completion": "^0.6.0",
"monolog/monolog": "^1.17",
"php": ">=7.1",
"php": ">=7.2",
"ext-sqlite3": "*",
"ext-pdo_sqlite": "*",
"lesstif/php-jira-rest-client": "^1.35"
Expand Down
7 changes: 4 additions & 3 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
</testsuites>
<!-- Filter for coverage reports. -->
<filter>
<whitelist>
<directory>./src</directory>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src</directory>
<exclude>
<directory>./tests</directory>
</exclude>
</whitelist>
<blacklist>
<directory>./tests</directory>
</blacklist>
</filter>
</phpunit>
33 changes: 30 additions & 3 deletions src/Connector/RedmineConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,39 @@
*/
class RedmineConnector implements Connector, ConfigurableService {

/**
* The http client.
*
* @var \GuzzleHttp\ClientInterface
*/
protected $httpClient;
/**
* The cache service.
*
* @var \Doctrine\Common\Cache\Cache
*/
protected $cache;
/**
* The URL.
*
* @var string
*/
protected $url;
/**
* The API keys.
*
* @var string
*/
protected $apiKey;
/**
* The list on non-billable projects.
*
* @var array
*/
protected $nonBillableProjects = [];
// 7 days cache.
/**
* Seven days cache.
*/
const LIFETIME = 604800;

/**
Expand Down Expand Up @@ -102,7 +129,7 @@ public function fetchCategories() {
}
$url = $this->url . '/enumerations/time_entry_activities.xml';
if ($xml = $this->fetch($url, $this->apiKey)) {
$categories = array();
$categories = [];
$i = 1;
foreach ($xml->time_entry_activity as $node) {
$categories[(string) str_pad($node->id, 3, 0, STR_PAD_LEFT)] = $node->name . ':' . $node->id;
Expand Down Expand Up @@ -310,7 +337,7 @@ protected function getStates() {
}
$url = $this->url . '/issue_statuses.xml';
if ($xml = $this->fetch($url, $this->apiKey)) {
$states = array();
$states = [];
foreach ($xml->issue_status as $node) {
$states[(string) $node->name] = (string) $node->id;
}
Expand Down
1 change: 1 addition & 0 deletions tests/TlTestBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ abstract class TlTestBase extends TestCase {
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$container = new ContainerBuilder();
$bin_dir = dirname(__DIR__) . '/';
$loader = new YamlFileLoader($container, new FileLocator($bin_dir));
Expand Down