Download the PHP package wheesnoza/assertable-json-enhancer without Composer

On this page you can find all versions of the php package wheesnoza/assertable-json-enhancer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package assertable-json-enhancer

wheesnoza/assertable-json-enhancer

Available Languages

wheesnoza/assertable-json-enhancer is a package that extends Laravel's AssertableJson class. This package enables more flexible and powerful assertions when testing JSON responses. It leverages the Macroable trait to provide several useful assertion methods.

Installation

You can install this package via Composer:

Usage

After installation, this package automatically registers the necessary macros to the AssertableJson class. No additional setup is required.

Compatibility

This package is fully compatible with Laravel Inertia's AssertableInertia. You can use the methods provided by wheesnoza/assertable-json-enhancer when writing assertions for Inertia responses.

Available Methods

Table of Contents

  1. whereStringContains
  2. whereLessThan
  3. whereLessThanOrEqual
  4. whereGreaterThan
  5. whereGreaterThanOrEqual
  6. whereIsArray
  7. whereArrayHasAtLeast
  8. whereArrayHasSize
  9. whereStringStartsWith
  10. whereStringEndsWith
  11. whereExactLength
  12. whereMatchesPattern
  13. whereIsString
  14. whereIsInteger
  15. whereIsBoolean
  16. whereIsFloat
  17. whereIsEmpty
  18. whereIsNotEmpty
  19. whereStringEquals
  20. whereStringNotEquals
  21. whereResultsAreOrderedBy
  22. whereResultsContain
  23. whereResultsMatchCriteria

1. whereStringContains(string $key, string $substring)

Asserts that the string at the given key contains the specified substring.

2. whereLessThan(string $key, int $value)

Asserts that the value at the given key is less than the specified value.

3. whereLessThanOrEqual(string $key, int $value)

Asserts that the value at the given key is less than or equal to the specified value.

4. whereGreaterThan(string $key, int $value)

Asserts that the value at the given key is greater than the specified value.

5. whereGreaterThanOrEqual(string $key, int $value)

Asserts that the value at the given key is greater than or equal to the specified value.

6. whereIsArray(string $key)

Asserts that the value at the given key is an array.

7. whereArrayHasAtLeast(string $key, int $minCount)

Asserts that the array at the given key has at least the specified number of elements.

8. whereArrayHasSize(string $key, int $size)

Asserts that the array at the given key has exactly the specified number of elements.

9. whereStringStartsWith(string $key, string $prefix)

Asserts that the string at the given key starts with the specified prefix.

10. whereStringEndsWith(string $key, string $suffix)

Asserts that the string at the given key ends with the specified suffix.

11. whereExactLength(string $key, int $length)

Asserts that the string at the given key has exactly the specified length.

12. whereMatchesPattern(string $key, string $pattern)

Asserts that the string at the given key matches the specified regular expression pattern.

13. whereIsString(string $key)

Asserts that the value at the given key is a string.

14. whereIsInteger(string $key)

Asserts that the value at the given key is an integer.

15. whereIsBoolean(string $key)

Asserts that the value at the given key is a boolean.

16. whereIsFloat(string $key)

Asserts that the value at the given key is a float.

17. whereIsEmpty(string $key)

Asserts that the value at the given key is empty (null, empty string, empty array, etc.).

18. whereIsNotEmpty(string $key)

Asserts that the value at the given key is not empty.

19. whereStringEquals(string $key, string $value)

Asserts that the string at the given key is exactly equal to the specified value.

20. whereStringNotEquals(string $key, string $value)

Asserts that the string at the given key is not equal to the specified value.

21. whereResultsAreOrderedBy(string $key, string $orderKey, string $direction = 'asc')

Asserts that the array at the given key is ordered by the specified key in the given direction.

22. whereResultsContain(string $key, $value)

Asserts that the array at the given key contains the specified value.

23. whereResultsMatchCriteria(string $key, array $criteria, bool $partialMatch = false)

Asserts that the array at the given key matches the specified criteria. If partialMatch is true, it allows partial matching of the criteria values.

Contributing

Contributions are welcome! Feel free to submit bug reports or pull requests. If you have any suggestions or improvements, please share them on GitHub.

License

This package is open-sourced software licensed under the MIT license.


All versions of assertable-json-enhancer with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
laravel/framework Version ^9.0|^10.0|^11.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package wheesnoza/assertable-json-enhancer contains the following files

Loading the files please wait ....