File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : tests
2+
3+ on :
4+ push :
5+ branches : [master]
6+ pull_request :
7+ branches : [master]
8+
9+ jobs :
10+ test :
11+ runs-on : ubuntu-latest
12+
13+ strategy :
14+ fail-fast : false
15+ matrix :
16+ php : ['8.2', '8.3']
17+ laravel : ['11.*', '12.*']
18+ include :
19+ - laravel : ' 11.*'
20+ testbench : ' 9.*'
21+ - laravel : ' 12.*'
22+ testbench : ' 10.*'
23+
24+ name : PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }}
25+
26+ steps :
27+ - name : Checkout
28+ uses : actions/checkout@v4
29+
30+ - name : Setup PHP
31+ uses : shivammathur/setup-php@v2
32+ with :
33+ php-version : ${{ matrix.php }}
34+ extensions : mbstring, pdo, pdo_sqlite
35+ coverage : none
36+
37+ - name : Install dependencies
38+ run : |
39+ composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
40+ composer update --prefer-dist --no-interaction --no-progress
41+
42+ - name : Run tests
43+ run : vendor/bin/phpunit
Original file line number Diff line number Diff line change 11# xnoire666/db-diff
22
33[ ![ Latest Version on Packagist] ( https://img.shields.io/packagist/v/xnoire666/db-diff.svg?style=flat-square )] ( https://packagist.org/packages/xnoire666/db-diff )
4+ [ ![ Tests] ( https://img.shields.io/github/actions/workflow/status/xnoire666/db-diff/tests.yml?branch=master&label=tests&style=flat-square )] ( https://github.com/xnoire666/db-diff/actions/workflows/tests.yml )
45[ ![ Total Downloads] ( https://img.shields.io/packagist/dt/xnoire666/db-diff.svg?style=flat-square )] ( https://packagist.org/packages/xnoire666/db-diff )
56[ ![ License] ( https://img.shields.io/packagist/l/xnoire666/db-diff.svg?style=flat-square )] ( https://packagist.org/packages/xnoire666/db-diff )
67
Original file line number Diff line number Diff line change 1717 "illuminate/filesystem" : " ^9.0|^10.0|^11.0|^12.0" ,
1818 "illuminate/support" : " ^9.0|^10.0|^11.0|^12.0"
1919 },
20+ "require-dev" : {
21+ "orchestra/testbench" : " ^8.0|^9.0|^10.0" ,
22+ "phpunit/phpunit" : " ^10.5|^11.0"
23+ },
2024 "autoload" : {
2125 "psr-4" : {
2226 "Xnoire666\\ DbDiff\\ " : " src/"
2327 }
2428 },
29+ "autoload-dev" : {
30+ "psr-4" : {
31+ "Xnoire666\\ DbDiff\\ Tests\\ " : " tests/"
32+ }
33+ },
34+ "scripts" : {
35+ "test" : " vendor/bin/phpunit"
36+ },
2537 "extra" : {
2638 "laravel" : {
2739 "providers" : [
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2+ <phpunit xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
3+ xsi : noNamespaceSchemaLocation =" vendor/phpunit/phpunit/phpunit.xsd"
4+ bootstrap =" vendor/autoload.php"
5+ colors =" true" >
6+ <testsuites >
7+ <testsuite name =" Unit" >
8+ <directory >tests/Unit</directory >
9+ </testsuite >
10+ </testsuites >
11+ <source >
12+ <include >
13+ <directory >src</directory >
14+ </include >
15+ </source >
16+ </phpunit >
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Xnoire666 \DbDiff \Tests ;
4+
5+ use Orchestra \Testbench \TestCase as OrchestraTestCase ;
6+ use Xnoire666 \DbDiff \DbDiffServiceProvider ;
7+
8+ abstract class TestCase extends OrchestraTestCase
9+ {
10+ protected function getPackageProviders ($ app ): array
11+ {
12+ return [DbDiffServiceProvider::class];
13+ }
14+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Xnoire666 \DbDiff \Tests \Unit ;
4+
5+ use Xnoire666 \DbDiff \Console \Commands \DbDiffCommand ;
6+ use Xnoire666 \DbDiff \Tests \TestCase ;
7+
8+ class DbDiffServiceProviderTest extends TestCase
9+ {
10+ public function test_config_is_merged (): void
11+ {
12+ $ this ->assertIsArray (config ('db-diff.connections ' ));
13+ $ this ->assertArrayHasKey ('mysql1 ' , config ('db-diff.connections ' ));
14+ $ this ->assertArrayHasKey ('mysql2 ' , config ('db-diff.connections ' ));
15+ }
16+
17+ public function test_db_diff_command_is_registered (): void
18+ {
19+ $ commands = $ this ->app [\Illuminate \Contracts \Console \Kernel::class]->all ();
20+
21+ $ this ->assertArrayHasKey ('db:diff ' , $ commands );
22+ $ this ->assertInstanceOf (DbDiffCommand::class, $ commands ['db:diff ' ]);
23+ }
24+
25+ public function test_config_file_is_publishable (): void
26+ {
27+ $ paths = \Illuminate \Support \ServiceProvider::pathsToPublish (
28+ \Xnoire666 \DbDiff \DbDiffServiceProvider::class,
29+ 'db-diff-config '
30+ );
31+
32+ $ this ->assertNotEmpty ($ paths );
33+ }
34+ }
You can’t perform that action at this time.
0 commit comments