PHPackages                             saritasa/laravel-testbed - 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. saritasa/laravel-testbed

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

saritasa/laravel-testbed
========================

Laravel Testbed

0.0.2(5y ago)1631MITPHPPHP &gt;=7.2

Since Nov 24Pushed 5y ago1 watchersCompare

[ Source](https://github.com/Saritasa/php-laravel-testbed)[ Packagist](https://packagist.org/packages/saritasa/laravel-testbed)[ Docs](https://github.com/Saritasa/php-laravel-testbed)[ RSS](/packages/saritasa-laravel-testbed/feed)WikiDiscussions master Synced 2d ago

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

Laravel Testbed
===============

[](#laravel-testbed)

[![Build Status](https://github.com/Saritasa/php-laravel-testbed/workflows/build/badge.svg)](https://github.com/Saritasa/php-laravel-testbed/actions)[![CodeCov](https://camo.githubusercontent.com/40587c3e1c96756fcf97ede9765228eb5cfaf6b7cf982af57f870bce85884921/68747470733a2f2f636f6465636f762e696f2f67682f53617269746173612f7068702d6c61726176656c2d746573746265642f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/Saritasa/php-laravel-testbed)[![Release](https://camo.githubusercontent.com/9122dc32cb0e75a0529bec8e6b728d84792332661379c447b7d193f85e917ffb/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f53617269746173612f7068702d6c61726176656c2d746573746265642e737667)](https://github.com/Saritasa/php-laravel-testbed/releases)[![PHPv](https://camo.githubusercontent.com/d8a02c1616220f3079426c22626e0a66399b7d998c96fb339b7e9e4cc8df746f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f73617269746173612f6c61726176656c2d746573746265642e737667)](http://www.php.net)[![Downloads](https://camo.githubusercontent.com/d1d27a591426bf81b66d8f61031984b62c0a2d7e3364ab4658bc2ccef11d9ede/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73617269746173612f6c61726176656c2d746573746265642e737667)](https://packagist.org/packages/saritasa/laravel-testbed)

Helpers for feature tests, like API sorting, authentication, registration, etc.

Usage
-----

[](#usage)

Install the `saritasa/laravel-testbed` package:

```
$ composer require saritasa/laravel-testbed
```

### ApiListSortingCheck Trait

[](#apilistsortingcheck-trait)

Trait to check if sorting works correctly.

Using trait:

```
use Saritasa\LaravelTestbed\Traits\ApiListSortingCheck;

/**
 * Vendor tests.
 */
class VendorTest extends TestCase
{
    use ApiListSortingCheck;
}
```

#### Available functions:

[](#available-functions)

```
/**
 * Check that API returns list sorted by specified field (order by single field - check for each of passed fields).
 *
 * @param string $url Api endpoint to check
 * @param int $count Count of created models
 * @param array|string[] $sortingFields Sorting fields to check
 * @param array|string[] $auth Auth
 * @param string|null $envelope Results envelope (like 'results', 'items', etc.)
 *
 * @return void
 */
public function assertSortingWorks(string $url, int $count, array $sortingFields, array $auth, ?string $envelope = null): void
/**
 * Check that API returns list sorted by specified fields
 *  (order by multiple fields - check for combinations of passed fields).
 *
 * @param string $url Api endpoint to check
 * @param int $count Count of created models
 * @param array|string[] $sortingFields Sorting fields to check
 * @param array|string[] $auth Auth
 * @param string|null $envelope Results envelope (like 'results', 'items', etc.)
 *
 * @return void
 */
public function assertMultiSortingWorks(string $url, int $count, array $sortingFields, array $auth, ?string $envelope = null): void
```

#### Examples:

[](#examples)

```
    /** Sorting options test */
    public function testOrderBy()
    {
        $count = 15;
        $auth = Helpers::createAndAuthenticateUser();

        factory(Vendor::class, $count)->create();

        $envelope = 'results';

        $this->assertSortingWorks("/api/vendors", $count, VendorListRequest::SORTING_FIELDS, $auth, $envelope);
    }

    /** Multi sorting options test */
    public function testMultiOrderBy()
    {
        $count = 15;
        $auth = Helpers::createAndAuthenticateUser();

        factory(Vendor::class, $count)->create();

        $envelope = 'results';

        $this->assertMultiSortingWorks("api/vendors", $count, VendorListRequest::SORTING_FIELDS, $auth, $envelope);
    }
```

*NOTE: If the response does not contain an **envelope** (such as "results", "items", etc.), you do not need to send this parameter.*

#### Sorting by single field

[](#sorting-by-single-field)

##### To sort by one field in ascending order, only the field name is used. For example:

[](#to-sort-by-one-field-in-ascending-order-only-the-field-name-is-used-for-example)

- api/vendors?order\_by=name
- api/vendors?order\_by=contacts.name

##### For sorting in descending order, the same is used, but with a minus. For example:

[](#for-sorting-in-descending-order-the-same-is-used-but-with-a-minus-for-example)

- api/vendors?order\_by=-name
- api/vendors?order\_by=-contacts.name

#### Sorting by several fields

[](#sorting-by-several-fields)

##### To sort by multiple fields in ascending order, enumerate the field names. For example:

[](#to-sort-by-multiple-fields-in-ascending-order-enumerate-the-field-names-for-example)

- api/vendors?order\_by=id,name
- api/vendors?order\_by=name,contacts.name

##### For sorting in descending order, the same is used, but with a minus. For example:

[](#for-sorting-in-descending-order-the-same-is-used-but-with-a-minus-for-example-1)

- api/vendors?order\_by=-id,name
- api/vendors?order\_by=-id,-contacts.name

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

[](#contributing)

See [CONTRIBUTING](CONTRIBUTING.md) and [Code of Conduct](CONDUCT.md), if you want to make contribution (pull request) or just build and test project on your own.

Resources
---------

[](#resources)

- [Changes History](CHANGES.md)
- [Bug Tracker](https://github.com/Saritasa/php-laravel-testbed/issues)
- [Authors](https://github.com/Saritasa/php-laravel-testbed/contributors)

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

Top contributor holds 84.2% 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

Every ~6 days

Total

2

Last Release

1987d ago

PHP version history (2 changes)0.0.1PHP &gt;=7.0

0.0.2PHP &gt;=7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/b7632cf2eb5dd552ace9d66947ed6919e19c6a2fdb5dc73b8c71e0f9886ccc83?d=identicon)[saritasa](/maintainers/saritasa)

---

Top Contributors

[![populov](https://avatars.githubusercontent.com/u/3766033?v=4)](https://github.com/populov "populov (16 commits)")[![sajke-shevchenko](https://avatars.githubusercontent.com/u/74931083?v=4)](https://github.com/sajke-shevchenko "sajke-shevchenko (3 commits)")

---

Tags

phpsaritasa

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/saritasa-laravel-testbed/health.svg)

```
[![Health](https://phpackages.com/badges/saritasa-laravel-testbed/health.svg)](https://phpackages.com/packages/saritasa-laravel-testbed)
```

###  Alternatives

[vimeo/psalm

A static analysis tool for finding errors in PHP applications

5.8k77.5M6.7k](/packages/vimeo-psalm)[larastan/larastan

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

6.4k43.5M5.2k](/packages/larastan-larastan)[dave-liddament/sarb

Provides tools for baselining static analysis results and comparing against that baseline

1651.4M](/packages/dave-liddament-sarb)[letsdrink/ouzo-goodies

Utility classes, test assertions and mocking framework extracted from Ouzo framework.

132617.9k7](/packages/letsdrink-ouzo-goodies)[quizlet/hammock

Hammock is a stand-alone mocking library for Hacklang.

27445.5k](/packages/quizlet-hammock)[doppiogancio/mocked-client

A simple way to mock a client

2174.9k3](/packages/doppiogancio-mocked-client)

PHPackages © 2026

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