Skip to content

Commit

Permalink
Test enhancement (#26)
Browse files Browse the repository at this point in the history
* fix travis setting

* replace PHPUnit namespace

* Test enhancement

* Test enhancement
  • Loading branch information
peter279k authored and ddeboer committed Jan 5, 2019
1 parent 496006d commit 91281f3
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
sudo: false

language: php

php:
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
}
],
"require": {
"php": ">=5.3.0"
"php": ">=5.6.0"
},
"require-dev": {
"ext-soap": "*",
"phpunit/phpunit": "^4.0 || ^5.0"
"phpunit/phpunit": "^5.7 || ^6.5"
},
"suggest": {
"ext-soap": "Required if you want to check the VAT number via VIES"
Expand Down
9 changes: 5 additions & 4 deletions tests/ValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
use Ddeboer\Vatin\Validator;
use Ddeboer\Vatin\Test\Mock\Vies\Response\CheckVatResponse;
use Ddeboer\Vatin\Vies\Client;
use PHPUnit\Framework\TestCase;

class ValidatorTest extends \PHPUnit_Framework_TestCase
class ValidatorTest extends TestCase
{
private $validator;

Expand Down Expand Up @@ -57,11 +58,11 @@ public function testInvalidWithVies()
$this->assertFalse($this->validator->isValid('NL123456789B01', true));
}


/**
* @expectedException \Ddeboer\Vatin\Exception\ViesException
*/
public function testWrongConnectionThrowsException()
{
$this->setExpectedException('\Ddeboer\Vatin\Exception\ViesException');

$this->validator = new Validator(new Client('meh'));
$this->validator->isValid('NL002065538B01', true);
}
Expand Down
6 changes: 4 additions & 2 deletions tests/Vies/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@
namespace Ddeboer\Vatin\Test\Vies;

use Ddeboer\Vatin\Vies\Client;
use Ddeboer\Vatin\Vies\Response\CheckVatResponse;
use PHPUnit\Framework\TestCase;

class ClientTest extends \PHPUnit_Framework_TestCase
class ClientTest extends TestCase
{
public function testCheckVat()
{
$client = new Client();
$response = $client->checkVat('NL', '123456789B01');

$this->assertInstanceOf('\Ddeboer\Vatin\Vies\Response\CheckVatResponse', $response);
$this->assertInstanceOf(CheckVatResponse::class, $response);
$this->assertFalse($response->isValid());
$this->assertEquals('NL', $response->getCountryCode());
$this->assertEquals('123456789B01', $response->getVatNumber());
Expand Down

0 comments on commit 91281f3

Please sign in to comment.