Skip to content

Commit

Permalink
Use latest PHP and tools
Browse files Browse the repository at this point in the history
  • Loading branch information
JeroenDeDauw committed Jan 4, 2018
1 parent 3ee696a commit d2c960e
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 29 deletions.
4 changes: 1 addition & 3 deletions .travis.yml
@@ -1,10 +1,8 @@
language: php

php:
- 5.5
- 5.6
- 7
- 7.1
- 7.2
- hhvm

sudo: false
Expand Down
15 changes: 7 additions & 8 deletions composer.json
Expand Up @@ -19,19 +19,18 @@
}
],
"require": {
"php": ">=5.5.0",
"php": ">=7.1",

"wikibase/data-model": "~6.0|~5.0|~4.0|~3.0|~2.5",
"wikibase/data-model": "~6.0",
"doctrine/dbal": "~2.4"
},
"require-dev": {
"ext-pdo_sqlite": "*",

"phpunit/phpunit": "~5.3.0|~4.8",
"whatthejeff/nyancat-phpunit-resultprinter": "~1.2",
"ockcyp/covers-validator": "~0.4.0",
"squizlabs/php_codesniffer": "~2.3",
"phpmd/phpmd": "~2.3"
"phpunit/phpunit": "~6.5",
"ockcyp/covers-validator": "~0.6.1",
"squizlabs/php_codesniffer": "~3.2",
"phpmd/phpmd": "~2.6"
},
"autoload": {
"psr-4": {
Expand All @@ -40,7 +39,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
"dev-master": "1.3.x-dev"
}
},
"scripts": {
Expand Down
5 changes: 1 addition & 4 deletions phpunit.xml.dist
Expand Up @@ -9,10 +9,7 @@
stopOnError="false"
stopOnFailure="false"
stopOnIncomplete="false"
stopOnSkipped="false"
verbose="true"
printerFile="vendor/whatthejeff/nyancat-phpunit-resultprinter/src/NyanCat/PHPUnit/ResultPrinter.php"
printerClass="NyanCat\PHPUnit\ResultPrinter">
stopOnSkipped="false">
<testsuites>
<testsuite name="QueryRTermStore">
<directory>tests</directory>
Expand Down
8 changes: 5 additions & 3 deletions tests/integration/TermStoreExceptionTest.php
Expand Up @@ -3,18 +3,20 @@
namespace Tests\Queryr\TermStore;

use Doctrine\DBAL\DriverManager;
use PHPUnit\Framework\TestCase;
use Queryr\TermStore\TermStore;
use Queryr\TermStore\TermStoreConfig;
use Queryr\TermStore\TermStoreException;
use Wikibase\DataModel\Entity\ItemId;
use Wikibase\DataModel\Term\Fingerprint;

/**
* @covers Queryr\TermStore\TermStore
* @covers \Queryr\TermStore\TermStore
*
* @licence GNU GPL v2+
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
*/
class TermStoreExceptionTest extends \PHPUnit_Framework_TestCase {
class TermStoreExceptionTest extends TestCase {

/**
* @var TermStore
Expand All @@ -36,7 +38,7 @@ public function testInsertWhenStoreNotInstalledCausesTermStoreException() {
$fingerprint = new Fingerprint();
$fingerprint->setLabel( 'en', 'EN label' );

$this->setExpectedException( 'Queryr\TermStore\TermStoreException' );
$this->expectException( TermStoreException::class );
$this->store->storeEntityFingerprint( $id, $fingerprint );
}

Expand Down
6 changes: 4 additions & 2 deletions tests/integration/TermStoreInstallerTest.php
Expand Up @@ -4,16 +4,17 @@

use Doctrine\DBAL\DriverManager;
use Doctrine\DBAL\Schema\AbstractSchemaManager;
use PHPUnit\Framework\TestCase;
use Queryr\TermStore\TermStoreConfig;
use Queryr\TermStore\TermStoreInstaller;

/**
* @covers Queryr\TermStore\TermStoreInstaller
* @covers \Queryr\TermStore\TermStoreInstaller
*
* @licence GNU GPL v2+
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
*/
class TermStoreInstallerTest extends \PHPUnit_Framework_TestCase {
class TermStoreInstallerTest extends TestCase {

/**
* @var TermStoreInstaller
Expand Down Expand Up @@ -49,6 +50,7 @@ public function testInstallationAndRemoval() {

public function testStoresPage() {
$this->storeInstaller->install();
$this->assertTrue( true );
}

}
11 changes: 6 additions & 5 deletions tests/integration/TermStoreTest.php
Expand Up @@ -2,22 +2,23 @@

namespace Tests\Queryr\TermStore;

use PHPUnit\Framework\TestCase;
use Queryr\TermStore\TermStore;
use Wikibase\DataModel\Entity\ItemId;
use Wikibase\DataModel\Entity\PropertyId;
use Wikibase\DataModel\Term\Fingerprint;

/**
* @covers Queryr\TermStore\TermStore
* @covers \Queryr\TermStore\TermStore
*
* @covers Queryr\TermStore\IdLookup
* @covers Queryr\TermStore\TermStoreWriter
* @covers Queryr\TermStore\TableQueryExecutor
* @covers \Queryr\TermStore\IdLookup
* @covers \Queryr\TermStore\TermStoreWriter
* @covers \Queryr\TermStore\TableQueryExecutor
*
* @licence GNU GPL v2+
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
*/
class TermStoreTest extends \PHPUnit_Framework_TestCase {
class TermStoreTest extends TestCase {

/**
* @var TermStore
Expand Down
10 changes: 6 additions & 4 deletions tests/integration/TermStoreWriterTest.php
Expand Up @@ -2,17 +2,19 @@

namespace Tests\Queryr\TermStore;

use PHPUnit\Framework\TestCase;
use Queryr\TermStore\TermStoreException;
use Queryr\TermStore\TermStoreWriter;
use Wikibase\DataModel\Entity\ItemId;
use Wikibase\DataModel\Term\Fingerprint;

/**
* @covers Queryr\TermStore\TermStoreWriter
* @covers \Queryr\TermStore\TermStoreWriter
*
* @licence GNU GPL v2+
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
*/
class TermStoreWriterTest extends \PHPUnit_Framework_TestCase {
class TermStoreWriterTest extends TestCase {

/**
* @var TermStoreWriter
Expand All @@ -26,14 +28,14 @@ public function setUp() {
public function testWhenNoConnection_storeEntityFingerprintThrowsException() {
$writer = TestEnvironment::newInstanceWithoutTables()->getFactory()->newTermStoreWriter();

$this->setExpectedException( 'Queryr\TermStore\TermStoreException' );
$this->expectException( TermStoreException::class );
$writer->storeEntityFingerprint( new ItemId( 'Q1' ), new Fingerprint() );
}

public function testWhenNoConnection_dropTermsForIdThrowsException() {
$writer = TestEnvironment::newInstanceWithoutTables()->getFactory()->newTermStoreWriter();

$this->setExpectedException( 'Queryr\TermStore\TermStoreException' );
$this->expectException( TermStoreException::class );
$writer->dropTermsForId( new ItemId( 'Q1' ) );
}

Expand Down

0 comments on commit d2c960e

Please sign in to comment.