-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from worksome/feature/pest-tests
ci: add initial Pest tests
- Loading branch information
Showing
9 changed files
with
125 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Tests | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
php-tests: | ||
name: Testing on PHP ${{ matrix.php }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
php: [8.2, 8.3] | ||
steps: | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
coverage: none | ||
|
||
- name: Setup Problem Matches | ||
run: | | ||
echo "::add-matcher::${{ runner.tool_cache }}/php.json" | ||
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" | ||
- name: Install PHP dependencies | ||
run: composer update --no-interaction --no-progress --ansi | ||
|
||
- name: Unit Tests | ||
run: composer test --ansi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
vendor | ||
composer.lock | ||
/build | ||
/vendor | ||
/.phpunit.cache | ||
/.php-cs-fixer.cache | ||
/composer.lock | ||
/phpunit.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"version":"pest_2.35.0","defects":{"P\\Tests\\Feature\\FoggyTest::__pest_evaluable_it_is_deferred":7},"times":{"P\\Tests\\Feature\\FoggyTest::__pest_evaluable_it_is_deferred":0.031,"P\\Tests\\Feature\\FoggyTest::__pest_evaluable_it_registers_the_Docker_command":0.027,"P\\Tests\\Feature\\FoggyTest::__pest_evaluable_it_registers_the__db_dump__command":0.022,"P\\Tests\\Feature\\FoggyServiceProviderTest::__pest_evaluable_it_registers_the__db_dump__command":0.014}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd" | ||
bootstrap="vendor/autoload.php" | ||
colors="true" | ||
cacheDirectory=".phpunit.cache"> | ||
<testsuites> | ||
<testsuite name="Test Suite"> | ||
<directory suffix="Test.php">tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
<source> | ||
<include> | ||
<directory suffix=".php">src</directory> | ||
</include> | ||
</source> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Worksome\FoggyLaravel\DatabaseDumpCommand; | ||
use Worksome\FoggyLaravel\FoggyServiceProvider; | ||
|
||
it('registers the `db:dump` command', function () { | ||
$provider = new FoggyServiceProvider($this->app); | ||
|
||
$provider->register(); | ||
|
||
$this->assertInstanceOf(DatabaseDumpCommand::class, $this->app[DatabaseDumpCommand::class]); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Worksome\FoggyLaravel\Tests\TestCase; | ||
|
||
uses(TestCase::class)->in(__DIR__); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Worksome\FoggyLaravel\Tests; | ||
|
||
use Orchestra\Testbench\TestCase as Orchestra; | ||
use Worksome\FoggyLaravel\FoggyServiceProvider; | ||
|
||
class TestCase extends Orchestra | ||
{ | ||
protected function getPackageProviders($app): array | ||
{ | ||
return [ | ||
FoggyServiceProvider::class, | ||
]; | ||
} | ||
} |