Skip to content

Commit

Permalink
chore: use sqlite for tests
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Poyigi <[email protected]>
  • Loading branch information
sampoyigi committed Jan 3, 2025
1 parent 9e423c3 commit 13688be
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
php: [ '8.2', '8.3' ]
uses: tastyigniter/workflows/.github/workflows/php-tests.yml@main
uses: tastyigniter/workflows/.github/workflows/php-tests-lite.yml@main
with:
php-version: ${{ matrix.target }}
composer: update --no-interaction --no-progress
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"laravel/pint": "^1.2",
"larastan/larastan": "^2.4.0",
"sampoyigi/testbench": "dev-main as 1.0",
"pestphp/pest-plugin-laravel": "^2.0"
"pestphp/pest-plugin-laravel": "^3.0"
},
"autoload": {
"psr-4": {
Expand All @@ -56,7 +56,7 @@
}
},
"scripts": {
"test": "vendor/bin/pest",
"test": "vendor/bin/pest --coverage --exactly=100",
"test-coverage": "vendor/bin/pest --coverage",
"format": "vendor/bin/pint",
"static": "vendor/bin/phpstan analyse --ansi --memory-limit 1056M"
Expand Down
4 changes: 1 addition & 3 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@
<php>
<env name="APP_ENV" value="testing"/>
<env name="APP_KEY" value="base64:YzE5YjR2b3hrem1ucmdmc2Fkbm92NW1veHBkMWdpa3k="/>
<env name="DB_CONNECTION" value="mysql"/>
<env name="DB_DATABASE" value="testbench"/>
<env name="DB_USERNAME" value="forge"/>
<env name="DB_CONNECTION" value="sqlite"/>
</php>
<source>
<include>
Expand Down
2 changes: 1 addition & 1 deletion tests/FormWidgets/PaymentAttemptsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
$this->expectException(FlashException::class);
$this->expectExceptionMessage('Record not found');

request()->merge(['recordId' => '1']);
request()->merge(['recordId' => '123']);

$this->widget->onLoadRecord();
});
Expand Down
4 changes: 4 additions & 0 deletions tests/Models/PaymentLogTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@

beforeEach(function() {
$this->paymentLog = new PaymentLog();
$this->paymentLog->payment_code = 'test_code';
$this->paymentLog->payment_name = 'Test Payment';
$this->paymentLog->message = 'Payment successful';
$this->order = Order::factory()->create();
$this->paymentLog->order_id = $this->order->getKey();
$this->paymentMethod = Mockery::mock(Payment::class)->makePartial();
$this->order->payment_method = $this->paymentMethod;
});
Expand Down
1 change: 1 addition & 0 deletions tests/Payments/PaypalExpressTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@
->for($this->payment, 'payment_method')
->create(['order_total' => 100]);
$paymentLog = PaymentLog::factory()->create([
'order_id' => $order->order_id,
'response' => ['purchase_units' => [['payments' => ['captures' => [['status' => 'not_completed']]]]]],
]);

Expand Down

0 comments on commit 13688be

Please sign in to comment.