wdda/laravel-finder-tests

This package uses reflection to find tests

v1.0.1 2018-10-23 11:36 UTC

This package is not auto-updated.

Last update: 2024-05-12 02:00:06 UTC


README

Software License Build Status

Laravel Finder Unit Tests.

Notice

The name of the class tests must match exactly with the name of the class

//Class
ClassName.php

//Test class
ClassNameTest.php

the name of the test methods and the name of the class methods must match

//In class
public function methodName() 
{
    ...
}
//In test class
public function testMethodName() 
{
    ...
}

Install

Install package:

$ composer require wdda/laravel-finder-tests --dev

Open your config/app.php and add the following to the providers array:

WDDA\LaravelFinderTests\FinderTestsProvider::class,

Run the command below to publish the package config file config/finder-tests.php:

php artisan vendor:publish --tag=finder-tests

Usage

php artisan finder-tests

or for option only not found

php artisan finder-tests --limit=1

axample all settings for config finder-tests.php

return  [
    'directory' => [
        [
            'rootPath' => app_path(),
            'classes' => [ //required
                'dir' => 'Modules/Models', //required
                'methodsExclude' => [
                    '__construct'
                ],
                'classesExclude' => [
                    'App\Modules\Models\Wiki'
                ]
            ],
            'tests' => [ //required
                'dir' => 'Modules/Tests/Unit', //required
                'methodsExclude' => [
                    'test'
                ],
                'classesExclude' => [
                    'App\Modules\Tests\Wiki'
                ]
            ]
        ],
        [
            //Other directory...
        ]
    ]
];

Testing

$ phpunit

Security

If you discover any security related issues, please email dima@wdda.pro instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.