Download the PHP package romegasoftware/nova-test-suite without Composer

On this page you can find all versions of the php package romegasoftware/nova-test-suite. 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 nova-test-suite

Nova Test Suite

[Travis]() Total Downloads

Install

composer require romegasoftware/nova-test-suite --dev

Usage

Generate Resource Test Cases

To get you started run php artisan nova:test resource_name. This will generate a Resource test and publish the NovaResourceTestCase if it was not already published.

First thing you will need to do after creating a resource tests is filling the remapResource() method. This method must map the nova fields names to the resource properties. It's also not needed to map each property of the resource, just the ones that change or are required to be diferent.

The $resource parameter is a fresh generated model instance via factory() and therefore should hold any necessary values you need. The $data parameter is only filled if you call a nova request method with any data like $this->storeResource(['name' => 'test']).

requests

get resources

store resources

If a resource is stored successfully the returned status code of the response is 201.

update resources

delete resources

relationships

assertHasOneRelationships(array) assertHasManyRelationships(array) assertBelongsToRelationships(array) assertBelongsToManyRelationships(array) assertMorphToRelationships(array) assertMorphOneRelationships(array) assertMorphManyRelationships(array)

actions

Use assertHasActions()

lenses

use assertHasLenses()

filters

use assertHasFilters()

Asserting a request has failed

Since failed nova request return a redirect with status code 301 we introduced a new method assertNovaFailed() which checks for this without having to think about what status code a failed nova response returns.

Testing required fields

To test if your Nova resource is setup correctly and check if all required fields are set as expected you can use the setNullValuesOn([..]) method, which assignes every key you enter a null value for the next request.

Using the default user

By default each nova request method checks whether a request was already authenticated through actingAs($user, 'api'). If no user was provided to authenticate the request we will use the getDefaultUser() method to authenticate your request. If you want to be explicit about using the default user for a request you can use $this->beDefaultUser() which will return the current class, therefore it will also work with chaining e.g. $this->beDefaultUser()->storeResource().

If you want to use your own user for every request you can override the getDefaultUser() method.

Debugging failing requests

To debug more easily why your nova request is failing you can chain assertSessionDoesntHaveErrors() before you make any assertions about the status. This method will dump all session errors and the json response of the request.

If you still can't figure out why you are receiving the status code of the response, try to get behind the reason of the response with withoutNovaExceptionHandling(). This method call will create a callback which calls the underlying withoutExceptionHandling() as soon as the Nova middleware runs. You can also chain the calls:

Testing

Run the tests with:

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Credits

Security

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

License

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


All versions of nova-test-suite with dependencies

PHP Build Version
Package Version
Requires php Version *
ext-json Version *
illuminate/support Version *
illuminate/filesystem Version *
illuminate/testing Version *
illuminate/contracts Version *
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 romegasoftware/nova-test-suite contains the following files

Loading the files please wait ....