Skip to content
Open
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ vendor

// OSX
.DS_Store

// Phpunit
.phpunit.result.cache
8 changes: 3 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
language: php

php:
- 5.4
- 5.5
- 5.6
- 5.5
- 7.0
- 7.1
- 7.2
- 7.3

before_install:
- phpenv config-rm xdebug.ini
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[![License](https://poser.pugx.org/ffwagency/borgerdk-php/license)](https://packagist.org/packages/ffwagency/borgerdk-php)

## Requirements
* PHP 5.4+
* PHP 7.1+

## Installation

Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
}
],
"require": {
"php": ">=5.4.0",
"symfony/dom-crawler": "2.8.*|3.2.*",
"symfony/css-selector": "2.8.*|3.2.*"
"php": ">=7.1.0",
"symfony/dom-crawler": "2.8.* || 3.4.* || 4.4.*",
"symfony/css-selector": "2.8.* || 3.4.* || 4.4.*"
},
"require-dev": {
"phpunit/phpunit": "4.8.*"
"phpunit/phpunit": "~6.5 || ~7 || ~8.4"
},
"autoload": {
"psr-4": {
Expand Down
10 changes: 7 additions & 3 deletions src/BorgerDk/ArticleService/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ class Client
*
* @var string
*/
protected $soapUrl = 'https://www.borger.dk/_vti_bin/borger/ArticleExport.svc?wsdl';
protected $soapUrlDa = 'https://www.borger.dk/_vti_bin/borger/ArticleExport.svc?wsdl';
protected $soapUrlEn = 'https://lifeindenmark.borger.dk/_vti_bin/borger/ArticleExport.svc?wsdl';

/**
* Array with debug options
Expand All @@ -45,12 +46,15 @@ class Client
/**
* Initiate the SoapClient connection.
*
* @param string $lang
*
* @throws \BorgerDk\ArticleService\Exceptions\SoapException
*/
public function __construct()
public function __construct($lang = 'da')
{
try {
$this->client = new SoapClient($this->soapUrl, $this->debug);
$soapUrl = (strcasecmp($lang, 'en') == 0) ? $this->soapUrlEn : $this->soapUrlDa;
$this->client = new SoapClient($soapUrl, $this->debug);
} catch (\SoapFault $fault) {
new SoapException($fault);
}
Expand Down
7 changes: 4 additions & 3 deletions tests/BorgerDk/ArticleService/UnitTests/BasicTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

namespace BorgerDk\ArticleService\UnitTests;

use PHPUnit_Framework_TestCase;
use PHPUnit\Framework\TestCase as UnitTestCase;
use BorgerDk\ArticleService;
use BorgerDk\ArticleService\Client as Client;

Expand All @@ -20,7 +20,7 @@
*
* @package BorgerDk\ArticleService
*/
abstract class BasicTest extends \PHPUnit_Framework_TestCase
abstract class BasicTest extends UnitTestCase
{
/**
* Client Connection
Expand Down Expand Up @@ -83,8 +83,9 @@ public function __construct($name = null, array $data = array(), $dataName = '')
/**
* Initiate the new Soap Client in the setup method.
*/
protected function setUp()
protected function setUp(): void
{
parent::setUp();
$this->client = new Client();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class GetAllArticlesTest extends BasicTest
/**
* Setup the endpoint request.
*/
public function setUp()
public function setUp(): void
{
parent::setUp();
$this->endpoint = new GetAllArticles($this->client);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*
* @package BorgerDk\ArticleService
*/
class GetAllSitesTEst extends BasicTest
class GetAllSitesTest extends BasicTest
{
/**
* @var object
Expand All @@ -29,7 +29,7 @@ class GetAllSitesTEst extends BasicTest
/**
* Setup the endpoint request.
*/
public function setUp()
public function setUp(): void
{
parent::setUp();
$this->endpoint = new GetAllSites($this->client);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class GetArticleByIDTest extends BasicTest
/**
* Setup the endpoint request.
*/
public function setUp()
public function setUp(): void
{
parent::setUp();
$params = array('articleID' => $this->articleId1, 'municipalityCode' => $this->municipalityCode);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class GetArticleIDByUrlTest extends BasicTest
/**
* Setup the endpoint request.
*/
public function setUp()
public function setUp(): void
{
parent::setUp();
$params = array('url' => $this->articleUrl);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class GetArticleIDsBySiteIDTest extends BasicTest
/**
* Setup the endpoint request.
*/
public function setUp()
public function setUp(): void
{
parent::setUp();
$params = array('siteID' => $this->siteId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class GetArticlesByIDsTest extends BasicTest
/**
* Setup the endpoint request.
*/
public function setUp()
public function setUp(): void
{
parent::setUp();
$articleIds = array($this->articleId1, $this->articleId2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class GetMunicipalityListTest extends BasicTest
/**
* Setup the endpoint request.
*/
public function setUp()
public function setUp(): void
{
parent::setUp();
$this->endpoint = new GetMunicipalityList($this->client);
Expand Down