Skip to content

Commit

Permalink
Fix prophecy to use trait, update maintainer details (#300)
Browse files Browse the repository at this point in the history
* Big rewrite to extend off a new base class so the prophecy trait can be used across the suite

* Update change of ownership within Vonage

* remove support for PHP7.2 + PHP7.3

* remove support for PHP7.2 + PHP7.3. Build support for 8.1

* split support for older php versions as a temporary measure until we make production catch up

* Update changelog
  • Loading branch information
SecondeJK committed Dec 13, 2021
1 parent 927d459 commit abd4047
Show file tree
Hide file tree
Showing 104 changed files with 236 additions and 212 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php: [ '7.2', '7.3', '7.4', '8.0' ]
php: [ '7.4', '8.0', '8.1' ]
name: PHP ${{ matrix.php }} Test

steps:
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# 2.10.0

### Fixed

* PHPUnit tests now no longer throw `prophesize()` depreciation notices

### Changed

* Maintainer and Contribution documents changed to reflect current ownership
* All test cases now extend off a the new `VonageTestCase` class that implements the `ProphesizeTrait`

# 2.9.3

### Fixed
Expand Down
7 changes: 4 additions & 3 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
## Maintainers

If you have any problems with our library, feel free to reach out to our
maintainers.
maintainer.

* [Chris Tankersley](https://github.com/dragonmantank)
* [Lorna Jane Mitchell](https://github.com/lornajane)
* [James Seconde](https://github.com/secondejk)

### Past Maintainers

* [Chris Tankersley](https://github.com/dragonmantank)
* [Lorna Jane Mitchell](https://github.com/lornajane)
* [Tim Lytle](https://github.com/tjlytle)
* [Micheal Heap](https://github.com/mheap)

Expand Down
17 changes: 7 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,9 @@
"license": "Apache-2.0",
"authors": [
{
"name": "Chris Tankersley",
"email": "chris.tankersley@vonage.com",
"role": "Developer"
},
{
"name": "Lorna Mitchell",
"email": "lorna.mitchell@vonage.com",
"role": "Developer"
"name": "James Seconde",
"email": "jim.seconde@vonage.com",
"role": "PHP Developer Advocate"
}
],
"require": {
Expand All @@ -29,14 +24,16 @@
"psr/log": "^1.1"
},
"require-dev": {
"php": ">=7.4",
"guzzlehttp/guzzle": ">=6",
"helmich/phpunit-json-assert": "^3.3",
"php-http/mock-client": "^1.4",
"phpstan/phpstan": "^0.12",
"phpunit/phpunit": "^8.5|^9.4",
"roave/security-advisories": "dev-latest",
"squizlabs/php_codesniffer": "^3.5",
"softcreatr/jsonpath": "^0.6.4"
"softcreatr/jsonpath": "^0.6.4",
"phpspec/prophecy-phpunit": "^2.0"
},
"config": {
"optimize-autoloader": true,
Expand All @@ -62,6 +59,6 @@
"email": "devrel@vonage.com",
"issues": "https://github.com/Vonage/vonage-php-sdk-core/issues",
"source": "https://github.com/Vonage/vonage-php-sdk-core",
"docs": "https://developer.nexmo.com"
"docs": "https://developer.vonage.com"
}
}
4 changes: 2 additions & 2 deletions test/Account/BalanceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@

namespace VonageTest\Account;

use PHPUnit\Framework\TestCase;
use VonageTest\VonageTestCase;
use Vonage\Account\Balance;
use Vonage\Client\Exception\Exception as ClientException;

class BalanceTest extends TestCase
class BalanceTest extends VonageTestCase
{
/**
* @var Balance
Expand Down
4 changes: 2 additions & 2 deletions test/Account/ClientFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@

namespace VonageTest\Account;

use PHPUnit\Framework\TestCase;
use VonageTest\VonageTestCase;
use Vonage\Account\ClientFactory;
use Vonage\Client;
use Vonage\Client\APIResource;
use Vonage\Client\Factory\MapFactory;

class ClientFactoryTest extends TestCase
class ClientFactoryTest extends VonageTestCase
{
/**
* @var MapFactory
Expand Down
6 changes: 4 additions & 2 deletions test/Account/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
namespace VonageTest\Account;

use Laminas\Diactoros\Response;
use PHPUnit\Framework\TestCase;
use VonageTest\VonageTestCase;
use Prophecy\Argument;
use Prophecy\PhpUnit\ProphecyTrait;
use Psr\Http\Client\ClientExceptionInterface;
use Psr\Http\Message\RequestInterface;
use Vonage\Account\Client as AccountClient;
Expand All @@ -29,10 +30,11 @@

use function fopen;

class ClientTest extends TestCase
class ClientTest extends VonageTestCase
{
use Psr7AssertionTrait;


protected $vonageClient;

/**
Expand Down
4 changes: 2 additions & 2 deletions test/Account/ConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@

namespace VonageTest\Account;

use PHPUnit\Framework\TestCase;
use VonageTest\VonageTestCase;
use Vonage\Account\Config;

class ConfigTest extends TestCase
class ConfigTest extends VonageTestCase
{
/**
* @var Config
Expand Down
4 changes: 2 additions & 2 deletions test/Account/PrefixPriceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
namespace VonageTest\Account;

use Exception;
use PHPUnit\Framework\TestCase;
use VonageTest\VonageTestCase;
use Vonage\Account\PrefixPrice;

class PrefixPriceTest extends TestCase
class PrefixPriceTest extends VonageTestCase
{
/**
* @dataProvider prefixPriceProvider
Expand Down
4 changes: 2 additions & 2 deletions test/Account/SecretCollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@

namespace VonageTest\Account;

use PHPUnit\Framework\TestCase;
use VonageTest\VonageTestCase;
use Vonage\Account\Secret;
use Vonage\Account\SecretCollection;
use Vonage\InvalidResponseException;

use function array_map;

class SecretCollectionTest extends TestCase
class SecretCollectionTest extends VonageTestCase
{
/**
* @var array[]
Expand Down
4 changes: 2 additions & 2 deletions test/Account/SecretTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@

namespace VonageTest\Account;

use PHPUnit\Framework\TestCase;
use VonageTest\VonageTestCase;
use Vonage\Account\Secret;
use Vonage\InvalidResponseException;

class SecretTest extends TestCase
class SecretTest extends VonageTestCase
{
/**
* @var Secret
Expand Down
4 changes: 2 additions & 2 deletions test/Account/SmsPriceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@

namespace VonageTest\Account;

use PHPUnit\Framework\TestCase;
use VonageTest\VonageTestCase;
use Vonage\Account\SmsPrice;

class SmsPriceTest extends TestCase
class SmsPriceTest extends VonageTestCase
{
/**
* @dataProvider smsPriceProvider
Expand Down
4 changes: 2 additions & 2 deletions test/ApiErrorHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
namespace VonageTest;

use Exception;
use PHPUnit\Framework\TestCase;
use VonageTest\VonageTestCase;
use Vonage\ApiErrorHandler;
use Vonage\Client\Exception\Request as RequestException;
use Vonage\Client\Exception\Server as ServerException;
use Vonage\Client\Exception\Validation as ValidationException;

class ApiErrorHandlerTest extends TestCase
class ApiErrorHandlerTest extends VonageTestCase
{
/**
* Valid HTTP responses do not throw an error
Expand Down
4 changes: 2 additions & 2 deletions test/Application/ApplicationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

use Exception;
use Laminas\Diactoros\Response;
use PHPUnit\Framework\TestCase;
use VonageTest\VonageTestCase;
use Vonage\Application\Application;
use Vonage\Application\MessagesConfig;
use Vonage\Application\RtcConfig;
Expand All @@ -22,7 +22,7 @@

use function fopen;

class ApplicationTest extends TestCase
class ApplicationTest extends VonageTestCase
{
/**
* @var Application
Expand Down
4 changes: 2 additions & 2 deletions test/Application/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
use Exception;
use Laminas\Diactoros\Request;
use Laminas\Diactoros\Response;
use PHPUnit\Framework\TestCase;
use VonageTest\VonageTestCase;
use Prophecy\Argument;
use Psr\Http\Client\ClientExceptionInterface;
use Psr\Http\Message\RequestInterface;
Expand All @@ -37,7 +37,7 @@
use function json_decode;
use function substr;

class ClientTest extends TestCase
class ClientTest extends VonageTestCase
{
use Psr7AssertionTrait;

Expand Down
4 changes: 2 additions & 2 deletions test/Application/FilterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
namespace VonageTest\Application;

use DateTime;
use PHPUnit\Framework\TestCase;
use VonageTest\VonageTestCase;
use Vonage\Application\Filter;

class FilterTest extends TestCase
class FilterTest extends VonageTestCase
{
/**
* @dataProvider ranges
Expand Down
4 changes: 2 additions & 2 deletions test/Call/CallTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
namespace VonageTest\Call;

use Laminas\Diactoros\Response;
use PHPUnit\Framework\TestCase;
use VonageTest\VonageTestCase;
use Prophecy\Argument;
use Psr\Http\Client\ClientExceptionInterface;
use Psr\Http\Message\RequestInterface;
Expand All @@ -34,7 +34,7 @@
use function json_decode;
use function json_encode;

class CallTest extends TestCase
class CallTest extends VonageTestCase
{
use Psr7AssertionTrait;

Expand Down
4 changes: 2 additions & 2 deletions test/Call/CollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
namespace VonageTest\Call;

use Laminas\Diactoros\Response;
use PHPUnit\Framework\TestCase;
use VonageTest\VonageTestCase;
use Prophecy\Argument;
use Psr\Http\Client\ClientExceptionInterface;
use Psr\Http\Message\RequestInterface;
Expand All @@ -27,7 +27,7 @@
use function fopen;
use function json_encode;

class CollectionTest extends TestCase
class CollectionTest extends VonageTestCase
{
use Psr7AssertionTrait;

Expand Down
4 changes: 2 additions & 2 deletions test/Call/DtmfTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
namespace VonageTest\Call;

use Laminas\Diactoros\Response;
use PHPUnit\Framework\TestCase;
use VonageTest\VonageTestCase;
use Prophecy\Argument;
use Psr\Http\Client\ClientExceptionInterface;
use Psr\Http\Message\RequestInterface;
Expand All @@ -25,7 +25,7 @@
use function json_decode;
use function json_encode;

class DtmfTest extends TestCase
class DtmfTest extends VonageTestCase
{
use Psr7AssertionTrait;

Expand Down
4 changes: 2 additions & 2 deletions test/Call/EarmuffTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
namespace VonageTest\Call;

use Helmich\JsonAssert\JsonAssertions;
use PHPUnit\Framework\TestCase;
use VonageTest\VonageTestCase;
use Vonage\Call\Earmuff;

use function file_get_contents;
use function json_decode;
use function json_encode;

class EarmuffTest extends TestCase
class EarmuffTest extends VonageTestCase
{
use JsonAssertions;

Expand Down
4 changes: 2 additions & 2 deletions test/Call/EventTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@

namespace VonageTest\Call;

use PHPUnit\Framework\TestCase;
use VonageTest\VonageTestCase;
use Vonage\Call\Event;
use VonageTest\Fixture\ResponseTrait;

class EventTest extends TestCase
class EventTest extends VonageTestCase
{
use ResponseTrait;

Expand Down
4 changes: 2 additions & 2 deletions test/Call/FilterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
namespace VonageTest\Call;

use DateTime;
use PHPUnit\Framework\TestCase;
use VonageTest\VonageTestCase;
use Vonage\Call\Filter;
use Vonage\Conversations\Conversation;

class FilterTest extends TestCase
class FilterTest extends VonageTestCase
{
/**
* @var Filter
Expand Down
4 changes: 2 additions & 2 deletions test/Call/HangupTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
namespace VonageTest\Call;

use Helmich\JsonAssert\JsonAssertions;
use PHPUnit\Framework\TestCase;
use VonageTest\VonageTestCase;
use Vonage\Call\Hangup;

use function file_get_contents;
use function json_decode;
use function json_encode;

class HangupTest extends TestCase
class HangupTest extends VonageTestCase
{
use JsonAssertions;

Expand Down
Loading

0 comments on commit abd4047

Please sign in to comment.