Skip to content

Commit

Permalink
migrating to phpunit 6, related to #684
Browse files Browse the repository at this point in the history
  • Loading branch information
Henri Ylikotila committed Jan 12, 2018
1 parent cfbaac6 commit db0318d
Show file tree
Hide file tree
Showing 20 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"monolog/monolog": "1.23.*"
},
"require-dev": {
"phpunit/phpunit": "4.8 - 5.4.5",
"phpunit/phpunit": "4.8 - 6.5.5",
"umpirsky/twig-gettext-extractor": "1.3.*",
"codeclimate/php-test-reporter": "0.4.4",
"symfony/dom-crawler": "3.4.3",
Expand Down
2 changes: 1 addition & 1 deletion tests/BreadcrumbTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

class BreadcrumbTest extends PHPUnit_Framework_TestCase
class BreadcrumbTest extends PHPUnit\Framework\TestCase
{

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/ConceptMappingPropertyValueTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

class ConceptMappingPropertyValueTest extends PHPUnit_Framework_TestCase
class ConceptMappingPropertyValueTest extends PHPUnit\Framework\TestCase
{
private $model;
private $concept;
Expand Down
2 changes: 1 addition & 1 deletion tests/ConceptPropertyTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

class ConceptPropertyTest extends PHPUnit_Framework_TestCase
class ConceptPropertyTest extends PHPUnit\Framework\TestCase
{
private $model;

Expand Down
4 changes: 2 additions & 2 deletions tests/ConceptPropertyValueLiteralTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

class ConceptPropertyValueLiteralTest extends PHPUnit_Framework_TestCase
class ConceptPropertyValueLiteralTest extends PHPUnit\Framework\TestCase
{
private $model;
private $concept;
Expand Down Expand Up @@ -52,7 +52,7 @@ public function testGetLabelThatIsADate() {

/**
* @covers ConceptPropertyValueLiteral::getLabel
* @expectedException PHPUnit_Framework_Error
* @expectedException PHPUnit\Framework\Error\Error
*/
public function testGetLabelThatIsABrokenDate() {
$vocab = $this->model->getVocabulary('dates');
Expand Down
2 changes: 1 addition & 1 deletion tests/ConceptPropertyValueTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

class ConceptPropertyValueTest extends PHPUnit_Framework_TestCase
class ConceptPropertyValueTest extends PHPUnit\Framework\TestCase
{
private $model;
private $concept;
Expand Down
2 changes: 1 addition & 1 deletion tests/ConceptSearchParametersTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

class ConceptSearchParametersTest extends PHPUnit_Framework_TestCase
class ConceptSearchParametersTest extends PHPUnit\Framework\TestCase
{
private $model;
private $request;
Expand Down
4 changes: 2 additions & 2 deletions tests/ConceptTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

class ConceptTest extends PHPUnit_Framework_TestCase
class ConceptTest extends PHPUnit\Framework\TestCase
{
private $model;
private $concept;
Expand Down Expand Up @@ -247,7 +247,7 @@ public function testGetDateWithCreatedAndModified() {
* @covers Concept::getDate
* @covers ConceptProperty::getValues
* @covers ConceptPropertyValueLiteral::getLabel
* @expectedException PHPUnit_Framework_Error
* @expectedException PHPUnit\Framework\Error\Error
*/

public function testGetTimestampInvalidWarning() {
Expand Down
2 changes: 1 addition & 1 deletion tests/DataObjectTest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

<?php

class DataObjectTest extends PHPUnit_Framework_TestCase
class DataObjectTest extends PHPUnit\Framework\TestCase
{

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/FeedbackTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use Symfony\Component\DomCrawler\Crawler;

class FeedbackTest extends PHPUnit_Framework_TestCase
class FeedbackTest extends PHPUnit\Framework\TestCase
{
private $model;
private $request;
Expand Down
2 changes: 1 addition & 1 deletion tests/GenericSparqlTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

class GenericSparqlTest extends PHPUnit_Framework_TestCase
class GenericSparqlTest extends PHPUnit\Framework\TestCase
{
private $model;
private $graph;
Expand Down
2 changes: 1 addition & 1 deletion tests/GlobalConfigTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

class GlobalConfigTest extends PHPUnit_Framework_TestCase
class GlobalConfigTest extends PHPUnit\Framework\TestCase
{

private $config;
Expand Down
2 changes: 1 addition & 1 deletion tests/JenaTextSparqlTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

class JenaTextSparqlTest extends PHPUnit_Framework_TestCase
class JenaTextSparqlTest extends PHPUnit\Framework\TestCase
{
private $model;
private $graph;
Expand Down
4 changes: 2 additions & 2 deletions tests/ModelTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

class ModelTest extends PHPUnit_Framework_TestCase
class ModelTest extends PHPUnit\Framework\TestCase
{
private $params;
private $model;
Expand Down Expand Up @@ -161,7 +161,7 @@ public function testSearchWithOnlyMultipleWildcards() {

/**
* @covers Model::searchConcepts
* @expectedException PHPUnit_Framework_Error
* @expectedException PHPUnit\Framework\Error\Error
*/
public function testSearchWithNoParams() {
$result = $this->model->searchConcepts();
Expand Down
2 changes: 1 addition & 1 deletion tests/PluginRegisterTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

class PluginRegisterTest extends PHPUnit_Framework_TestCase
class PluginRegisterTest extends PHPUnit\Framework\TestCase
{
private $model;
private $concept;
Expand Down
2 changes: 1 addition & 1 deletion tests/RequestTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

class RequestTest extends PHPUnit_Framework_TestCase
class RequestTest extends PHPUnit\Framework\TestCase
{
private $model;
private $request;
Expand Down
2 changes: 1 addition & 1 deletion tests/VocabularyCategoryTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

class VocabularyCategoryTest extends PHPUnit_Framework_TestCase
class VocabularyCategoryTest extends PHPUnit\Framework\TestCase
{
private $model;
private $mockres;
Expand Down
6 changes: 3 additions & 3 deletions tests/VocabularyConfigTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

class VocabularyConfigTest extends PHPUnit_Framework_TestCase
class VocabularyConfigTest extends PHPUnit\Framework\TestCase
{

private $model;
Expand Down Expand Up @@ -105,7 +105,7 @@ public function testGetDefaultLanguage() {

/**
* @covers VocabularyConfig::getDefaultLanguage
* @expectedException PHPUnit_Framework_Error
* @expectedException PHPUnit\Framework\Error\Error
*/
public function testGetDefaultLanguageWhenNotSet() {
$vocab = $this->model->getVocabulary('testdiff');
Expand Down Expand Up @@ -164,7 +164,7 @@ public function testGetDataURLs() {

/**
* @covers VocabularyConfig::getDataURLs
* @expectedException PHPUnit_Framework_Error_Warning
* @expectedException PHPUnit\Framework\Error\Warning
*/
public function testGetDataURLsNotGuessable() {
$vocab = $this->model->getVocabulary('test');
Expand Down
2 changes: 1 addition & 1 deletion tests/VocabularyDataObjectTest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

<?php

class VocabularyDataObjectTest extends PHPUnit_Framework_TestCase
class VocabularyDataObjectTest extends PHPUnit\Framework\TestCase
{

/**
Expand Down
6 changes: 3 additions & 3 deletions tests/VocabularyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require_once('model/Model.php');

class VocabularyTest extends PHPUnit_Framework_TestCase
class VocabularyTest extends \PHPUnit\Framework\TestCase
{

private $model;
Expand Down Expand Up @@ -297,7 +297,7 @@ public function testSearchConceptsAlphabeticalEverything() {
public function testGetBreadCrumbs() {
$model = new Model(new GlobalConfig('/../tests/testconfig.inc'));
$resource = $this->getMockBuilder('EasyRdf\Resource')->disableOriginalConstructor()->getMock();
$vocabstub = $this->getMock('Vocabulary', array('getConceptTransitiveBroaders'), array($model, $resource));
$vocabstub = $this->getMockBuilder('Vocabulary')->setMethods(array('getConceptTransitiveBroaders'))->setConstructorArgs(array($model, $resource))->getMock();
$vocabstub->method('getConceptTransitiveBroaders')->willReturn(array ( 'http://www.yso.fi/onto/yso/p4762' => array ( 'label' => 'objects', ), 'http://www.yso.fi/onto/yso/p1674' => array ( 'label' => 'physical whole', 'direct' => array ( 0 => 'http://www.yso.fi/onto/yso/p4762', ), ), 'http://www.yso.fi/onto/yso/p14606' => array ( 'label' => 'layers', 'direct' => array ( 0 => 'http://www.yso.fi/onto/yso/p1674', ), ), ));
$result = $vocabstub->getBreadCrumbs('en', 'http://www.yso.fi/onto/yso/p14606');
foreach($result['breadcrumbs'][0] as $crumb)
Expand All @@ -312,7 +312,7 @@ public function testGetBreadCrumbs() {
public function testGetBreadCrumbsShortening() {
$model = new Model(new GlobalConfig('/../tests/testconfig.inc'));
$resource = $this->getMockBuilder('EasyRdf\Resource')->disableOriginalConstructor()->getMock();
$vocabstub = $this->getMock('Vocabulary', array('getConceptTransitiveBroaders'), array($model, $resource));
$vocabstub = $this->getMockBuilder('Vocabulary')->setMethods(array('getConceptTransitiveBroaders'))->setConstructorArgs(array($model, $resource))->getMock();
$vocabstub->method('getConceptTransitiveBroaders')->willReturn(array ( 'http://www.yso.fi/onto/yso/p4762' => array ( 'label' => 'objects', ), 'http://www.yso.fi/onto/yso/p13871' => array ( 'label' => 'thai language', 'direct' => array ( 0 => 'http://www.yso.fi/onto/yso/p10834', ), ), 'http://www.yso.fi/onto/yso/p556' => array ( 'label' => 'languages', 'direct' => array ( 0 => 'http://www.yso.fi/onto/yso/p2881', ), ), 'http://www.yso.fi/onto/yso/p8965' => array ( 'label' => 'Sino-Tibetan languages', 'direct' => array ( 0 => 'http://www.yso.fi/onto/yso/p556', ), ), 'http://www.yso.fi/onto/yso/p3358' => array ( 'label' => 'systems', 'direct' => array ( 0 => 'http://www.yso.fi/onto/yso/p4762', ), ), 'http://www.yso.fi/onto/yso/p10834' => array ( 'label' => 'Tai languages', 'direct' => array ( 0 => 'http://www.yso.fi/onto/yso/p8965', ), ), 'http://www.yso.fi/onto/yso/p2881' => array ( 'label' => 'cultural systems', 'direct' => array ( 0 => 'http://www.yso.fi/onto/yso/p3358', ), ), ) );
$result = $vocabstub->getBreadCrumbs('en', 'http://www.yso.fi/onto/yso/p13871');
$this->assertEquals(6, sizeof($result['breadcrumbs'][0]));
Expand Down

0 comments on commit db0318d

Please sign in to comment.