PHPackages                             axitbv/laravel-blueprint-streamlined-test-addon - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. axitbv/laravel-blueprint-streamlined-test-addon

ActiveLibrary[Testing &amp; Quality](/categories/testing)

axitbv/laravel-blueprint-streamlined-test-addon
===============================================

Swap Blueprint's TestGenerator with my own \*too fancy\* and \*too specific\*, \*streamlined\* tests for API Resource Controllers

0.0.1(5y ago)136744[1 issues](https://github.com/axitbv/laravel-blueprint-streamlined-test-addon/issues)[1 PRs](https://github.com/axitbv/laravel-blueprint-streamlined-test-addon/pulls)MITPHPPHP ^7.3

Since Jul 1Pushed 5y ago2 watchersCompare

[ Source](https://github.com/axitbv/laravel-blueprint-streamlined-test-addon)[ Packagist](https://packagist.org/packages/axitbv/laravel-blueprint-streamlined-test-addon)[ Docs](https://github.com/axitbv/laravel-blueprint-streamlined-test-addon)[ RSS](/packages/axitbv-laravel-blueprint-streamlined-test-addon/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (1)Dependencies (5)Versions (3)Used By (0)

Laravel Blueprint Streamlined Tests Addon
=========================================

[](#laravel-blueprint-streamlined-tests-addon)

[![Latest Version on Packagist](https://camo.githubusercontent.com/360f5c0a643e9b71f611213b6eebe10b589003eff7d907d54335559da4b2f80c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6178697462762f6c61726176656c2d626c75657072696e742d73747265616d6c696e65642d746573742d6164646f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/axitbv/laravel-blueprint-streamlined-test-addon)[![Build Status](https://camo.githubusercontent.com/09ee81953b07bbd74a7e79d4bec3a820286a98a8f66bcc5a1e4bfaac0135b609/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6178697462762f6c61726176656c2d626c75657072696e742d73747265616d6c696e65642d746573742d6164646f6e2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/axitbv/laravel-blueprint-streamlined-test-addon)[![Quality Score](https://camo.githubusercontent.com/e4353f5a826a794ce4a15926973c20fc3c7651cd42e43edb0fca71c9ddc47545/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6178697462762f6c61726176656c2d626c75657072696e742d73747265616d6c696e65642d746573742d6164646f6e2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/axitbv/laravel-blueprint-streamlined-test-addon)[![Total Downloads](https://camo.githubusercontent.com/bab2b6917789fba15cd6dd5849330553757e3f2c3a82cf45b81bc4dbc6c458fa/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6178697462762f6c61726176656c2d626c75657072696e742d73747265616d6c696e65642d746573742d6164646f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/axitbv/laravel-blueprint-streamlined-test-addon)

Swaps Blueprint's TestGenerator with my own [*too fancy* and *too specific*, *streamlined* tests](https://github.com/laravel-shift/blueprint/pull/220) for API Resource Controllers.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require laravel-shift/blueprint axitbv/laravel-blueprint-streamlined-test-addon
```

Usage
-----

[](#usage)

Create your blueprint draft.yaml as usual. In order to generate the streamlined tests that this package provides, be sure to include the `resource: api` shorthand in your `controllers:` section:

```
models:
  Certificate:
    name: string
    certificate_type_id: id
    reference: string
    document: string
    expiry_date: date
    remarks: nullable text
  CertificateType:
    name: string
    relationships:
      hasMany: Certificate

controllers:
  Certificate:
    resource: api
  CertificateType:
    resource: api
```

This `resource: api` shorthand expands to generate an API resource controller, form requests, resources and resource collections. Yet, instead of the broken tests that currently come out of the box with Blueprint, it will provide you with a *very opinionated*, yet *working* testsuite for the geneated code, with 100% code coverage.

```
php artisan blueprint:build
```

Which will yield:

```
- database/migrations/2020_07_01_073301_create_certificates_table.php
- database/migrations/2020_07_01_073302_create_certificate_types_table.php
- app/Certificate.php
- app/CertificateType.php
- database/factories/CertificateFactory.php
- database/factories/CertificateTypeFactory.php
- app/Http/Controllers/CertificateController.php
- app/Http/Controllers/CertificateTypeController.php
- app/Http/Requests/CertificateStoreRequest.php
- app/Http/Requests/CertificateUpdateRequest.php
- app/Http/Requests/CertificateTypeStoreRequest.php
- app/Http/Requests/CertificateTypeUpdateRequest.php
- app/Http/Resources/CertificateCollection.php
- app/Http/Resources/Certificate.php
- app/Http/Resources/CertificateTypeCollection.php
- app/Http/Resources/CertificateType.php
- tests/Feature/Http/Controllers/CertificateControllerTest.php
- tests/Feature/Http/Controllers/CertificateTypeControllerTest.php
```

Then, either run `php artisan test`:

```
❯ php artisan test

   PASS  Tests\Unit\ExampleTest
  ✓ basic test

   PASS  Tests\Feature\ExampleTest
  ✓ basic test

   PASS  Tests\Feature\Http\Controllers\CertificateControllerTest
  ✓ index behaves as expected
  ✓ store uses form request validation
  ✓ store saves
  ✓ show behaves as expected
  ✓ update uses form request validation
  ✓ update behaves as expected
  ✓ destroy deletes and responds with

   PASS  Tests\Feature\Http\Controllers\CertificateTypeControllerTest
  ✓ index behaves as expected
  ✓ store uses form request validation
  ✓ store saves
  ✓ show behaves as expected
  ✓ update uses form request validation
  ✓ update behaves as expected
  ✓ destroy deletes and responds with

  Tests:  16 passed
  Time:   0.55s
```

Or use `phpunit`:

```
❯ phpunit --coverage-text                                                                                                                                                                                                         72%
PHPUnit 8.5.8 by Sebastian Bergmann and contributors.

................                                                  16 / 16 (100%)

Time: 668 ms, Memory: 30.00 MB

OK (16 tests, 28 assertions)

Code Coverage Report:
  2020-07-01 07:41:44

 Summary:
  Classes: 51.85% (14/27)
  Methods: 64.58% (31/48)
  Lines:   63.16% (60/95)

\App\Console::App\Console\Kernel
  Methods:  50.00% ( 1/ 2)   Lines:  75.00% (  3/  4)
\App\Http\Controllers::App\Http\Controllers\CertificateController
  Methods: 100.00% ( 5/ 5)   Lines: 100.00% (  9/  9)
\App\Http\Controllers::App\Http\Controllers\CertificateTypeController
  Methods: 100.00% ( 5/ 5)   Lines: 100.00% (  9/  9)
\App\Http\Requests::App\Http\Requests\CertificateStoreRequest
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% (  2/  2)
\App\Http\Requests::App\Http\Requests\CertificateTypeStoreRequest
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% (  2/  2)
\App\Http\Requests::App\Http\Requests\CertificateTypeUpdateRequest
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% (  2/  2)
\App\Http\Requests::App\Http\Requests\CertificateUpdateRequest
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% (  2/  2)
\App\Http\Resources::App\Http\Resources\Certificate
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  7/  7)
\App\Http\Resources::App\Http\Resources\CertificateCollection
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  1/  1)
\App\Http\Resources::App\Http\Resources\CertificateType
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  2/  2)
\App\Http\Resources::App\Http\Resources\CertificateTypeCollection
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  1/  1)
\App\Providers::App\Providers\AppServiceProvider
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% (  2/  2)
\App\Providers::App\Providers\AuthServiceProvider
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  2/  2)
\App\Providers::App\Providers\EventServiceProvider
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  2/  2)
\App\Providers::App\Providers\RouteServiceProvider
  Methods: 100.00% ( 4/ 4)   Lines: 100.00% ( 14/ 14)
```

For code coverage reporting, install PCOV using `pecl install pcov` and invoke phpunit with `--coverage-text`.

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

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

Credits
-------

[](#credits)

- [Joost Jacobs](https://github.com/axit-joost)
- [All Contributors](../../contributors)

Big Thank You To
----------------

[](#big-thank-you-to)

- [Jason McCreary](https://github.com/jasonmccreary) for creating [Blueprint](https://github.com/laravel-shift/blueprint), the constructive feedback, your vision and allowing Blueprint to swap Generators.
- [Daniel Mason](https://github.com/dmason30) for inspiring me with [Blueprint Pest Addon](https://github.com/fidum/laravel-blueprint-pestphp-addon) that generates PestPHP test code

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2142d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/24fab1c08fcb23880af3d86982ce81939672210502fb5441d4fdeaa1c4dba29f?d=identicon)[axit.joost](/maintainers/axit.joost)

---

Top Contributors

[![axit-joost](https://avatars.githubusercontent.com/u/13835397?v=4)](https://github.com/axit-joost "axit-joost (8 commits)")

---

Tags

axitbvlaravel-blueprint-streamlined-test-addon

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/axitbv-laravel-blueprint-streamlined-test-addon/health.svg)

```
[![Health](https://phpackages.com/badges/axitbv-laravel-blueprint-streamlined-test-addon/health.svg)](https://phpackages.com/packages/axitbv-laravel-blueprint-streamlined-test-addon)
```

###  Alternatives

[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.4k43.5M5.2k](/packages/larastan-larastan)[timacdonald/log-fake

A drop in fake logger for testing with the Laravel framework.

4235.9M56](/packages/timacdonald-log-fake)[illuminate/testing

The Illuminate Testing package.

3315.6M113](/packages/illuminate-testing)[christophrumpel/missing-livewire-assertions

This package adds missing livewire test assertions.

149336.0k9](/packages/christophrumpel-missing-livewire-assertions)[calebdw/larastan-livewire

A Larastan / PHPStan extension for Livewire.

43482.4k3](/packages/calebdw-larastan-livewire)[encodia/laravel-health-env-vars

Custom check for Spatie's Laravel Health - Ensure every .env variable you need has been set

20143.5k](/packages/encodia-laravel-health-env-vars)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
