Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: resolve deprecation notices when using Composer 1.10(-dev) #918

Merged
merged 1 commit into from
Feb 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
"type": "library",
"autoload": {
"psr-4": {
"SendGrid\\": "lib/",
"SendGrid\\Mail\\": "lib/mail/",
"SendGrid\\Contacts\\": "lib/contacts/",
"SendGrid\\Stats\\": "lib/stats/"
Expand All @@ -41,7 +40,9 @@
},
"autoload-dev": {
"psr-4": {
"SendGrid\\Tests\\": "test/"
}
"SendGrid\\Tests\\Integration\\": "test/integration",
"SendGrid\\Tests\\Unit\\": "test/unit"
},
"files": ["test/BaseTestClass.php"]
}
}
27 changes: 15 additions & 12 deletions test/BaseTestClass.php
Original file line number Diff line number Diff line change
@@ -1,56 +1,59 @@
<?php
/**
* This file contains the base class for testing the request object
* This file contains the base class for testing the request object
* generation for a /mail/send API call
*
*
* PHP Version - 5.6, 7.0, 7.1, 7.2
*
* @package SendGrid\Tests
* @author Elmer Thomas <dx@sendgrid.com>
* @copyright 2018-19 Twilio SendGrid
* @license https://opensource.org/licenses/MIT The MIT License
* @version GIT: <git_id>
* @link http://packagist.org/packages/sendgrid/sendgrid
* @link http://packagist.org/packages/sendgrid/sendgrid
*/
namespace SendGrid\Tests;

use PHPUnit\Framework\TestCase;
use SendGrid;
use Swaggest\JsonDiff\Exception;
use Swaggest\JsonDiff\JsonDiff;
use Swaggest\JsonDiff\JsonPatch;

/**
* This class facilitates testing the request object
* This class facilitates testing the request object
* generation for a /mail/send API call
*
*
* @package SendGrid\Mail
*/
class BaseTestClass extends TestCase
{
// @var string Twilio SendGrid API Key
/** @var string Twilio SendGrid API Key */
protected static $apiKey;
// @var SendGrid Twilio SendGrid client
/** @var SendGrid Twilio SendGrid client */
protected static $sg;

/**
* This method is run before the classes are initialised
*
*
* @return null
*/
public static function setUpBeforeClass()
{
self::$apiKey = "SENDGRID_API_KEY";
$host = ['host' => 'http://localhost:4010'];
self::$sg = new \SendGrid(self::$apiKey, $host);
self::$sg = new SendGrid(self::$apiKey, $host);
}

/**
* Compares to JSON objects and returns True if equal,
* Compares to JSON objects and returns True if equal,
* else return array of differences
*
*
* @param string $json1 A string representation of a JSON object
* @param string $json2 A string representation of a JSON object
*
*
* @return bool|array
* @throws Exception
*/
public static function compareJSONObjects($json1, $json2)
{
Expand Down
4 changes: 3 additions & 1 deletion test/integration/Alerts/AlertsTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php

namespace SendGrid\Tests;
namespace SendGrid\Tests\Integration\Alerts;

use SendGrid\Tests\BaseTestClass;

class AlertsTest extends BaseTestClass
{
Expand Down
2 changes: 1 addition & 1 deletion test/integration/ApiKeys/ApiKeysTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace SendGrid\Tests\ApiKeys;
namespace SendGrid\Tests\Integration\ApiKeys;

use SendGrid\Tests\BaseTestClass;

Expand Down
2 changes: 1 addition & 1 deletion test/integration/Asm/AsmGroupsTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace SendGrid\Tests\Asm;
namespace SendGrid\Tests\Integration\Asm;

use SendGrid\Tests\BaseTestClass;

Expand Down
2 changes: 1 addition & 1 deletion test/integration/Asm/AsmSuppressionTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace SendGrid\Tests\Asm;
namespace SendGrid\Tests\Integration\Asm;

use SendGrid\Tests\BaseTestClass;

Expand Down
2 changes: 1 addition & 1 deletion test/integration/Campaigns/CampaignsTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace SendGrid\Tests\Campaigns;
namespace SendGrid\Tests\Integration\Campaigns;

use SendGrid\Tests\BaseTestClass;

Expand Down
2 changes: 1 addition & 1 deletion test/integration/Categories/CategoriesTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace SendGrid\Tests\Categories;
namespace SendGrid\Tests\Integration\Categories;

use SendGrid\Tests\BaseTestClass;

Expand Down
2 changes: 1 addition & 1 deletion test/integration/Contacts/ContactDbTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace SendGrid\Tests\Contacts;
namespace SendGrid\Tests\Integration\Contacts;

use SendGrid\Tests\BaseTestClass;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php
namespace SendGrid\Tests;
namespace SendGrid\Tests\Integration\Helpers\Contacts;

use SendGrid\Tests\BaseTestClass;
use SendGrid\Contacts\RecipientForm;
use SendGrid\Contacts\Recipient;

class RecipientsTestRecipient extends BaseTestClass
class RecipientsTest extends BaseTestClass
{
public function testRecipientsForm()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace SendGrid\Tests;
namespace SendGrid\Tests\Integration\Helpers\Stats;

use SendGrid\Tests\BaseTestClass;
use SendGrid\Stats\Stats;
Expand Down Expand Up @@ -47,7 +47,7 @@ public function testGetValues(
* @param array $expectedSum
* @param array $expectedSubuserMonthly
* @dataProvider invalidValues
* @expectedException Exception
* @expectedException \Exception
*/
public function testGetValuesFail(
$expectedGlobal,
Expand Down
2 changes: 1 addition & 1 deletion test/integration/Ip/IpPoolsTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace SendGrid\Tests\Ip;
namespace SendGrid\Tests\Integration\Ip;

use SendGrid\Tests\BaseTestClass;

Expand Down
2 changes: 1 addition & 1 deletion test/integration/Ip/IpsTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace SendGrid\Tests\Ip;
namespace SendGrid\Tests\Integration\Ip;

use SendGrid\Tests\BaseTestClass;

Expand Down
2 changes: 1 addition & 1 deletion test/integration/Ip/IpsWarmupTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace SendGrid\Tests\Ip;
namespace SendGrid\Tests\Integration\Ip;

use SendGrid\Tests\BaseTestClass;

Expand Down
2 changes: 1 addition & 1 deletion test/integration/Mail/MailBatchTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace SendGrid\Tests\Mail;
namespace SendGrid\Tests\Integration\Mail;

use SendGrid\Tests\BaseTestClass;

Expand Down
2 changes: 1 addition & 1 deletion test/integration/Mail/MailSendTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace SendGrid\Tests\Mail;
namespace SendGrid\Tests\Integration\Mail;

use SendGrid\Tests\BaseTestClass;

Expand Down
2 changes: 1 addition & 1 deletion test/integration/Mail/MailSettingsTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace SendGrid\Tests\Mail;
namespace SendGrid\Tests\Integration\Mail;

use SendGrid\Tests\BaseTestClass;

Expand Down
2 changes: 1 addition & 1 deletion test/integration/Mail/MailboxProvidersTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace SendGrid\Tests\Mail;
namespace SendGrid\Tests\Integration\Mail;

use SendGrid\Tests\BaseTestClass;

Expand Down
2 changes: 1 addition & 1 deletion test/integration/Scopes/ScopesTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace SendGrid\Tests\Scopes;
namespace SendGrid\Tests\Integration\Scopes;

use SendGrid\Tests\BaseTestClass;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace SendGrid\Tests\Whitelabel;
namespace SendGrid\Tests\Integration\SenderAuthentication;

use SendGrid\Tests\BaseTestClass;

class WhitelabelDomainsTest extends BaseTestClass
class DomainAuthenticationTest extends BaseTestClass
{
public function testWhitelabelDomainsPostMethod()
{
Expand Down
4 changes: 2 additions & 2 deletions test/integration/SenderAuthentication/LinkBrandingTest.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace SendGrid\Tests\Whitelabel;
namespace SendGrid\Tests\Integration\SenderAuthentication;

use SendGrid\Tests\BaseTestClass;

class WhitelabelLinksTest extends BaseTestClass
class LinkBrandingTest extends BaseTestClass
{
public function testWhitelabelLinksPostMethod()
{
Expand Down
4 changes: 2 additions & 2 deletions test/integration/SenderAuthentication/ReverseDNSTest.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace SendGrid\Tests\Whitelabel;
namespace SendGrid\Tests\Integration\SenderAuthentication;

use SendGrid\Tests\BaseTestClass;

class WhitelabelIpsTest extends BaseTestClass
class ReverseDNSTest extends BaseTestClass
{
public function testWhitelabelIpsPostMethod()
{
Expand Down
2 changes: 1 addition & 1 deletion test/integration/Senders/SendersTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace SendGrid\Tests\Senders;
namespace SendGrid\Tests\Integration\Senders;

use SendGrid\Tests\BaseTestClass;

Expand Down
2 changes: 1 addition & 1 deletion test/integration/Settings/AccessSettingsTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace SendGrid\Tests\Settings;
namespace SendGrid\Tests\Integration\Settings;

use SendGrid\Tests\BaseTestClass;

Expand Down
2 changes: 1 addition & 1 deletion test/integration/Settings/PartnerSettingsTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace SendGrid\Tests\Settings;
namespace SendGrid\Tests\Integration\Settings;

use SendGrid\Tests\BaseTestClass;

Expand Down
2 changes: 1 addition & 1 deletion test/integration/Settings/TrackingSettingsTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace SendGrid\Tests\Settings;
namespace SendGrid\Tests\Integration\Settings;

use SendGrid\Tests\BaseTestClass;

Expand Down
2 changes: 1 addition & 1 deletion test/integration/Stats/BrowserStatsTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace SendGrid\Tests\Stats;
namespace SendGrid\Tests\Integration\Stats;

use SendGrid\Tests\BaseTestClass;

Expand Down
2 changes: 1 addition & 1 deletion test/integration/Stats/ClientsStatsTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace SendGrid\Tests\Stats;
namespace SendGrid\Tests\Integration\Stats;

use SendGrid\Tests\BaseTestClass;

Expand Down
2 changes: 1 addition & 1 deletion test/integration/Stats/DevicesStatsTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace SendGrid\Tests\Stats;
namespace SendGrid\Tests\Integration\Stats;

use SendGrid\Tests\BaseTestClass;

Expand Down
2 changes: 1 addition & 1 deletion test/integration/Stats/GeoStatsTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace SendGrid\Tests\Stats;
namespace SendGrid\Tests\Integration\Stats;

use SendGrid\Tests\BaseTestClass;

Expand Down
2 changes: 1 addition & 1 deletion test/integration/Stats/StatsTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace SendGrid\Tests\Stats;
namespace SendGrid\Tests\Integration\Stats;

use SendGrid\Tests\BaseTestClass;

Expand Down
2 changes: 1 addition & 1 deletion test/integration/Subusers/SubUsersTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace SendGrid\Tests\Subusers;
namespace SendGrid\Tests\Integration\Subusers;

use SendGrid\Tests\BaseTestClass;

Expand Down
2 changes: 1 addition & 1 deletion test/integration/Suppression/SuppressionBlocksTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace SendGrid\Tests\Suppression;
namespace SendGrid\Tests\Integration\Suppression;

use SendGrid\Tests\BaseTestClass;

Expand Down
2 changes: 1 addition & 1 deletion test/integration/Suppression/SuppressionBouncesTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace SendGrid\Tests\Suppression;
namespace SendGrid\Tests\Integration\Suppression;

use SendGrid\Tests\BaseTestClass;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace SendGrid\Tests\Suppression;
namespace SendGrid\Tests\Integration\Suppression;

use SendGrid\Tests\BaseTestClass;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace SendGrid\Tests\Suppression;
namespace SendGrid\Tests\Integration\Suppression;

use SendGrid\Tests\BaseTestClass;

Expand Down