Skip to content

Commit

Permalink
Use orchestral/testbench for tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
srmklive committed Jun 24, 2024
1 parent f0398d6 commit 836c7cd
Show file tree
Hide file tree
Showing 58 changed files with 95 additions and 54 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ composer.lock
test.php
/.venv
/docs/build
/node_modules
package*.json
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"nesbot/carbon": "~2.0|^3.0"
},
"require-dev": {
"orchestra/testbench": "^9.1",
"pestphp/pest": "~2.0",
"phpstan/phpstan": "^1.10",
"symfony/var-dumper": "~5.0|^6.0|^7.0"
Expand Down
1 change: 0 additions & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
<file>src/PayPalFacadeAccessor.php</file>
<file>src/Traits/PayPalVerifyIPN.php</file>
<file>src/Services/Str.php</file>
<directory suffix=".php">src/Commands/</directory>
<directory suffix=".php">src/Facades/</directory>
<directory suffix=".php">src/Providers/</directory>
</exclude>
Expand Down
16 changes: 16 additions & 0 deletions testbench.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
providers:
- Srmklive\PayPal\Providers\PayPalServiceProvider

workbench:
start: '/'
install: true
health: false
discovers:
web: false
api: false
commands: true
components: false
views: false
build: []
assets: []
sync: []
23 changes: 23 additions & 0 deletions tests/Commands/PublishAssetsCommandTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

namespace Srmklive\PayPal\Tests\Commands;

use Illuminate\Support\Facades\Artisan;
use Orchestra\Testbench\Concerns\WithWorkbench;
use Orchestra\Testbench\TestCase;
use PHPUnit\Framework\Attributes\Test;

class PublishAssetsCommandTest extends TestCase
{
use withWorkbench;

#[Test]
public function it_can_run_artisan_command(): void
{
Artisan::call('paypal:install');
$output = Artisan::output();

$this->assertStringContainsString('Installing the PayPal JS SDK through npm', $output);
$this->assertStringContainsString('Installed the PayPal JS SDK.', $output);
}
}
2 changes: 1 addition & 1 deletion tests/Feature/AdapterBillingPlansPricingHelpersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Srmklive\PayPal\Tests\Feature;

use Orchestra\Testbench\TestCase;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;
use Srmklive\PayPal\Services\PayPal as PayPalClient;
use Srmklive\PayPal\Tests\MockClientClasses;
use Srmklive\PayPal\Tests\MockResponsePayloads;
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/AdapterConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Srmklive\PayPal\Tests\Feature;

use Orchestra\Testbench\TestCase;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;
use Srmklive\PayPal\Services\PayPal as PayPalClient;
use Srmklive\PayPal\Tests\MockClientClasses;

Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/AdapterCreateSubscriptionHelpersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
namespace Srmklive\PayPal\Tests\Feature;

use Carbon\Carbon;
use Orchestra\Testbench\TestCase;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;
use Srmklive\PayPal\Services\PayPal as PayPalClient;
use Srmklive\PayPal\Tests\MockClientClasses;
use Srmklive\PayPal\Tests\MockResponsePayloads;
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/AdapterExperienceContextTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
namespace Srmklive\PayPal\Tests\Feature;

use Carbon\Carbon;
use Orchestra\Testbench\TestCase;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;
use Srmklive\PayPal\Services\PayPal as PayPalClient;
use Srmklive\PayPal\Tests\MockClientClasses;
use Srmklive\PayPal\Tests\MockRequestPayloads;
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/AdapterFeatureTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
namespace Srmklive\PayPal\Tests\Feature;

use Carbon\Carbon;
use Orchestra\Testbench\TestCase;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;
use Srmklive\PayPal\Services\PayPal as PayPalClient;
use Srmklive\PayPal\Tests\MockClientClasses;
use Srmklive\PayPal\Tests\MockRequestPayloads;
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/AdapterOrdersHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
namespace Srmklive\PayPal\Tests\Feature;

use Carbon\Carbon;
use Orchestra\Testbench\TestCase;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;
use Srmklive\PayPal\Services\PayPal as PayPalClient;
use Srmklive\PayPal\Tests\MockClientClasses;
use Srmklive\PayPal\Tests\MockRequestPayloads;
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/AdapterPaymentMethodTokensHelpersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Srmklive\PayPal\Tests\Feature;

use Orchestra\Testbench\TestCase;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;
use Srmklive\PayPal\Services\PayPal as PayPalClient;
use Srmklive\PayPal\Tests\MockClientClasses;
use Srmklive\PayPal\Tests\MockRequestPayloads;
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Adapter/BillingPlansTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Srmklive\PayPal\Tests\Unit\Adapter;

use Orchestra\Testbench\TestCase;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;
use Srmklive\PayPal\Tests\MockClientClasses;
use Srmklive\PayPal\Tests\MockRequestPayloads;
use Srmklive\PayPal\Tests\MockResponsePayloads;
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Adapter/CatalogProductsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Srmklive\PayPal\Tests\Unit\Adapter;

use Orchestra\Testbench\TestCase;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;
use Srmklive\PayPal\Tests\MockClientClasses;
use Srmklive\PayPal\Tests\MockRequestPayloads;
use Srmklive\PayPal\Tests\MockResponsePayloads;
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Adapter/DisputeActionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Srmklive\PayPal\Tests\Unit\Adapter;

use Orchestra\Testbench\TestCase;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;
use Srmklive\PayPal\Tests\MockClientClasses;
use Srmklive\PayPal\Tests\MockResponsePayloads;

Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Adapter/DisputesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Srmklive\PayPal\Tests\Unit\Adapter;

use Orchestra\Testbench\TestCase;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;
use Srmklive\PayPal\Tests\MockClientClasses;
use Srmklive\PayPal\Tests\MockRequestPayloads;
use Srmklive\PayPal\Tests\MockResponsePayloads;
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Adapter/IdentityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Srmklive\PayPal\Tests\Unit\Adapter;

use Orchestra\Testbench\TestCase;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;
use Srmklive\PayPal\Tests\MockClientClasses;
use Srmklive\PayPal\Tests\MockRequestPayloads;
use Srmklive\PayPal\Tests\MockResponsePayloads;
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Adapter/InvoicesSearchTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Srmklive\PayPal\Tests\Unit\Adapter;

use Orchestra\Testbench\TestCase;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;
use Srmklive\PayPal\Tests\MockClientClasses;
use Srmklive\PayPal\Tests\MockRequestPayloads;
use Srmklive\PayPal\Tests\MockResponsePayloads;
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Adapter/InvoicesTemplatesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Srmklive\PayPal\Tests\Unit\Adapter;

use Orchestra\Testbench\TestCase;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;
use Srmklive\PayPal\Tests\MockClientClasses;
use Srmklive\PayPal\Tests\MockRequestPayloads;
use Srmklive\PayPal\Tests\MockResponsePayloads;
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Adapter/InvoicesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Srmklive\PayPal\Tests\Unit\Adapter;

use Orchestra\Testbench\TestCase;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;
use Srmklive\PayPal\Tests\MockClientClasses;
use Srmklive\PayPal\Tests\MockRequestPayloads;
use Srmklive\PayPal\Tests\MockResponsePayloads;
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Adapter/OrdersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Srmklive\PayPal\Tests\Unit\Adapter;

use Orchestra\Testbench\TestCase;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;
use Srmklive\PayPal\Tests\MockClientClasses;
use Srmklive\PayPal\Tests\MockRequestPayloads;
use Srmklive\PayPal\Tests\MockResponsePayloads;
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Adapter/PartnerReferralsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Srmklive\PayPal\Tests\Unit\Adapter;

use Orchestra\Testbench\TestCase;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;
use Srmklive\PayPal\Tests\MockClientClasses;
use Srmklive\PayPal\Tests\MockRequestPayloads;
use Srmklive\PayPal\Tests\MockResponsePayloads;
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Adapter/PaymentAuthorizationsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Srmklive\PayPal\Tests\Unit\Adapter;

use Orchestra\Testbench\TestCase;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;
use Srmklive\PayPal\Tests\MockClientClasses;
use Srmklive\PayPal\Tests\MockResponsePayloads;

Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Adapter/PaymentCapturesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Srmklive\PayPal\Tests\Unit\Adapter;

use Orchestra\Testbench\TestCase;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;
use Srmklive\PayPal\Tests\MockClientClasses;
use Srmklive\PayPal\Tests\MockResponsePayloads;

Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Adapter/PaymentExperienceWebProfilesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Srmklive\PayPal\Tests\Unit\Adapter;

use Orchestra\Testbench\TestCase;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;
use Srmklive\PayPal\Tests\MockClientClasses;
use Srmklive\PayPal\Tests\MockRequestPayloads;
use Srmklive\PayPal\Tests\MockResponsePayloads;
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Adapter/PaymentRefundsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Srmklive\PayPal\Tests\Unit\Adapter;

use Orchestra\Testbench\TestCase;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;
use Srmklive\PayPal\Tests\MockClientClasses;
use Srmklive\PayPal\Tests\MockResponsePayloads;

Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Adapter/PayoutsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Srmklive\PayPal\Tests\Unit\Adapter;

use Orchestra\Testbench\TestCase;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;
use Srmklive\PayPal\Tests\MockClientClasses;
use Srmklive\PayPal\Tests\MockRequestPayloads;
use Srmklive\PayPal\Tests\MockResponsePayloads;
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Adapter/ReferencedPayoutsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Srmklive\PayPal\Tests\Unit\Adapter;

use Orchestra\Testbench\TestCase;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;
use Srmklive\PayPal\Tests\MockClientClasses;
use Srmklive\PayPal\Tests\MockRequestPayloads;
use Srmklive\PayPal\Tests\MockResponsePayloads;
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Adapter/ReportingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
namespace Srmklive\PayPal\Tests\Unit\Adapter;

use Carbon\Carbon;
use Orchestra\Testbench\TestCase;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;
use Srmklive\PayPal\Tests\MockClientClasses;
use Srmklive\PayPal\Tests\MockResponsePayloads;

Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Adapter/SubscriptionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Srmklive\PayPal\Tests\Unit\Adapter;

use Orchestra\Testbench\TestCase;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;
use Srmklive\PayPal\Tests\MockClientClasses;
use Srmklive\PayPal\Tests\MockRequestPayloads;
use Srmklive\PayPal\Tests\MockResponsePayloads;
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Adapter/TrackersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Srmklive\PayPal\Tests\Unit\Adapter;

use Orchestra\Testbench\TestCase;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;
use Srmklive\PayPal\Tests\MockClientClasses;
use Srmklive\PayPal\Tests\MockRequestPayloads;
use Srmklive\PayPal\Tests\MockResponsePayloads;
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Adapter/WebHooksEventsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Srmklive\PayPal\Tests\Unit\Adapter;

use Orchestra\Testbench\TestCase;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;
use Srmklive\PayPal\Tests\MockClientClasses;
use Srmklive\PayPal\Tests\MockResponsePayloads;

Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Adapter/WebHooksTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Srmklive\PayPal\Tests\Unit\Adapter;

use Orchestra\Testbench\TestCase;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;
use Srmklive\PayPal\Tests\MockClientClasses;
use Srmklive\PayPal\Tests\MockRequestPayloads;
use Srmklive\PayPal\Tests\MockResponsePayloads;
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Adapter/WebHooksVerificationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Srmklive\PayPal\Tests\Unit\Adapter;

use Orchestra\Testbench\TestCase;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;
use Srmklive\PayPal\Tests\MockClientClasses;
use Srmklive\PayPal\Tests\MockRequestPayloads;
use Srmklive\PayPal\Tests\MockResponsePayloads;
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/AdapterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Srmklive\PayPal\Tests\Unit;

use Orchestra\Testbench\TestCase;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;
use Srmklive\PayPal\Services\PayPal as PayPalClient;
use Srmklive\PayPal\Tests\MockClientClasses;
use Srmklive\PayPal\Tests\MockResponsePayloads;
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Client/BillingPlansTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
namespace Srmklive\PayPal\Tests\Unit\Client;

use GuzzleHttp\Utils;
use Orchestra\Testbench\TestCase;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;
use Srmklive\PayPal\Tests\MockClientClasses;
use Srmklive\PayPal\Tests\MockRequestPayloads;
use Srmklive\PayPal\Tests\MockResponsePayloads;
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Client/CatalogProductsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
namespace Srmklive\PayPal\Tests\Unit\Client;

use GuzzleHttp\Utils;
use Orchestra\Testbench\TestCase;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;
use Srmklive\PayPal\Tests\MockClientClasses;
use Srmklive\PayPal\Tests\MockRequestPayloads;
use Srmklive\PayPal\Tests\MockResponsePayloads;
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Client/DisputeActionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
namespace Srmklive\PayPal\Tests\Unit\Client;

use GuzzleHttp\Utils;
use Orchestra\Testbench\TestCase;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;
use Srmklive\PayPal\Tests\MockClientClasses;
use Srmklive\PayPal\Tests\MockRequestPayloads;
use Srmklive\PayPal\Tests\MockResponsePayloads;
Expand Down
Loading

0 comments on commit 836c7cd

Please sign in to comment.