Skip to content

Commit

Permalink
Version bump
Browse files Browse the repository at this point in the history
- Bump minimal required version to PHP 7.2
- Update dependency for PHPUnit
- Update tests for new PHPUnit version
  • Loading branch information
canihavesomecoffee committed Feb 24, 2019
1 parent 5577837 commit f24ead7
Show file tree
Hide file tree
Showing 24 changed files with 64 additions and 271 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ build
vendor
# Composer lock
composer.lock
# PHP Unit cache
.phpunit.result.cache
5 changes: 3 additions & 2 deletions .idea/php.xml

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

3 changes: 2 additions & 1 deletion .idea/thetvdbapi.iml

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

4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ language: php
sudo: false

php:
- 7.1
- 7.1snapshot
- 7.2
- 7.2snapshot
- 7.3
- master

before_install:
Expand Down
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@
}
],
"require": {
"php": ">=7.1",
"php": ">=7.2",
"guzzlehttp/guzzle": "^6.2",
"symfony/serializer": "^3.2",
"symfony/property-access": "^3.3",
"symfony/property-info": "^3.3"
"symfony/property-info": "^3.3",
"ext-json": "*"
},
"require-dev": {
"phpunit/phpunit": "^6.1"
"phpunit/phpunit": "^8"
},
"autoload": {
"psr-4": {
Expand Down
160 changes: 0 additions & 160 deletions tests/BaseUnitTest.php

This file was deleted.

4 changes: 2 additions & 2 deletions tests/DataParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
use CanIHaveSomeCoffee\TheTVDbAPI\DataParser;
use CanIHaveSomeCoffee\TheTVDbAPI\Model\BasicEpisode;
use CanIHaveSomeCoffee\TheTVDbAPI\Model\BasicSeries;
use CanIHaveSomeCoffee\TheTVDbAPI\Model\Episode;
use CanIHaveSomeCoffee\TheTVDbAPI\Model\Image;
use CanIHaveSomeCoffee\TheTVDbAPI\Model\RatingsInfo;
use PHPUnit\Framework\TestCase;

/**
* Class DataParserTest
Expand All @@ -32,7 +32,7 @@
* @license See start of document
* @link https://canihavesome.coffee/projects/theTVDbAPI
*/
class DataParserTest extends BaseUnitTest
class DataParserTest extends TestCase
{
public function testParseBasicEpisodeData()
{
Expand Down
4 changes: 2 additions & 2 deletions tests/ExceptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
use CanIHaveSomeCoffee\TheTVDbAPI\Exception\ResourceNotFoundException;
use CanIHaveSomeCoffee\TheTVDbAPI\Exception\ParseException;
use CanIHaveSomeCoffee\TheTVDbAPI\Exception\ConflictException;
use function GuzzleHttp\Psr7\parse_query;
use PHPUnit\Framework\TestCase;

/**
* Class ExceptionTest
Expand All @@ -31,7 +31,7 @@
* @license See start of document
* @link https://canihavesome.coffee/projects/theTVDbAPI
*/
class ExceptionTest extends BaseUnitTest
class ExceptionTest extends TestCase
{


Expand Down
12 changes: 6 additions & 6 deletions tests/Model/EpisodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
namespace CanIHaveSomeCoffee\TheTVDbAPI\Tests\Model;

use CanIHaveSomeCoffee\TheTVDbAPI\Model\Episode;
use CanIHaveSomeCoffee\TheTVDbAPI\Tests\BaseUnitTest;
use PHPUnit\Framework\TestCase;

/**
* Class EpisodeTest
Expand All @@ -28,23 +28,23 @@
* @license See start of document
* @link https://canihavesome.coffee/projects/theTVDbAPI
*/
class EpisodeTest extends BaseUnitTest
class EpisodeTest extends TestCase
{
public function testDirectorCreation()
{
$director = 'Foo Bar Baz';
$episode = new Episode();
static::assertAttributeCount(0, 'directors', $episode);
static::assertEquals(0, sizeof($episode->directors));
$episode->setDirector($director);
static::assertAttributeCount(1, 'directors', $episode);
static::assertAttributeContains($director, 'directors', $episode);
static::assertEquals(1, sizeof($episode->directors));
static::assertContains($director, $episode->directors);
}

public function testDirectorRetrieval()
{
$director = 'Foo Bar Baz';
$episode = new Episode();
static::assertAttributeCount(0, 'directors', $episode);
static::assertEquals(0, sizeof($episode->directors));
static::assertEquals('', $episode->getDirector());
$episode->directors[] = $director;
static::assertEquals($director, $episode->getDirector());
Expand Down
4 changes: 2 additions & 2 deletions tests/Model/JSONErrorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
namespace CanIHaveSomeCoffee\TheTVDbAPI\Tests\Model;

use CanIHaveSomeCoffee\TheTVDbAPI\Model\JSONError;
use CanIHaveSomeCoffee\TheTVDbAPI\Tests\BaseUnitTest;
use PHPUnit\Framework\TestCase;

/**
* Class JSONErrorTest
Expand All @@ -28,7 +28,7 @@
* @license See start of document
* @link https://canihavesome.coffee/projects/theTVDbAPI
*/
class JSONErrorTest extends BaseUnitTest
class JSONErrorTest extends TestCase
{
public function testDataRetrieval()
{
Expand Down
13 changes: 2 additions & 11 deletions tests/Model/PaginatedResultsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
namespace CanIHaveSomeCoffee\TheTVDbAPI\Tests\Model;

use CanIHaveSomeCoffee\TheTVDbAPI\Model\PaginatedResults;
use CanIHaveSomeCoffee\TheTVDbAPI\Tests\BaseUnitTest;
use PHPUnit\Framework\TestCase;

/**
* Class PaginatedResultsTest
Expand All @@ -28,17 +28,8 @@
* @license See start of document
* @link https://canihavesome.coffee/projects/theTVDbAPI
*/
class PaginatedResultsTest extends BaseUnitTest
class PaginatedResultsTest extends TestCase
{
public function testCreation()
{
$data = ['foo' => 'bar', 'baz' => 'foo'];
$links = ['previous' => 0, 'next' => 2, 'first' => 0, 'last' => 1337];
$instance = new PaginatedResults($data, $links);
static::assertAttributeSame($data, 'data', $instance);
static::assertAttributeSame($links, 'links', $instance);
}

public function testRetrieveData()
{
$data = ['foo' => 'bar', 'baz' => 'foo'];
Expand Down
3 changes: 1 addition & 2 deletions tests/Model/RatingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
namespace CanIHaveSomeCoffee\TheTVDbAPI\Tests\Model;

use CanIHaveSomeCoffee\TheTVDbAPI\Model\Rating;
use CanIHaveSomeCoffee\TheTVDbAPI\Tests\BaseUnitTest;
use InvalidArgumentException;
use PHPUnit\Framework\TestCase;

Expand All @@ -30,7 +29,7 @@
* @license See start of document
* @link https://canihavesome.coffee/projects/theTVDbAPI
*/
class RatingTest extends BaseUnitTest
class RatingTest extends TestCase
{
public function testIsValidRatingType()
{
Expand Down
Loading

0 comments on commit f24ead7

Please sign in to comment.