Download the PHP package mpndev/d8tdd without Composer

On this page you can find all versions of the php package mpndev/d8tdd. 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 d8tdd

You want to test Drupal-8.*

Now that's a very challenging task! For every test you need to write tons and tons of preparation code.


Here are some helpful tools!

Install via composer:


Lets start with the Kernel tests for your module.

First you need to create an abstract class that extends KernelTestBase class. KernelTestBase lives in this library.





Factories:


Let's assume we need Node instance from bundle "project". The very first thing is to define factory for default "project" implementation.

Open MyModuleKernelTestBase.php and add the following in the setUp method



Here you have access to the "Faker" library. Click here to see the full list of a available methods.





If you need to make an instance of a "project" in your tests you can do so by using:



$project will be fresh content type of bundle "project"




You can override and add fields on the fly:



This will override the default behavior of the "factory" for bundle "project"




You can also make multiple instances of "project" like this:



That will give you an array of 15 "projects".




If you use "create" instead of "make", factory will save the "project" in the database:





You can "make" "project" and save it later (normal Drupal stuff):





You can access the “project” instance by using closure as a third argument in the “make” or “create” methods. By doing so you can modify the “project” instance i.e. by adding something via a reference field:



IMPORTANT!!!

- In closure, always return the passed instance variable! (In our example $project_instance);

- appendItem() method will expect the saved instance to be in the database for the attached item! (In our example "environment", that was created on the fly, again with factory);





HttpRequest:


Helper, that makes available requests for testing endpoints.

The request will not go outside. Instead, it will be handled from the Drupal kernel, and the response can be inspected. Nice isn't it?









Attach cookie:





Attach content:





Attach server:




Attach files:




JsonRequest:


Helper, that makes available json requests (with application/json header) for testing endpoints.

The request will not go outside. Instead, it will be handled from the Drupal kernel, and the response can be inspected. The same like HttpRequest Helper.









Attach cookie:





Attach content:





Attach server:




Attach files:




Happy testing :)


All versions of d8tdd with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2.0
fzaninotto/faker Version ^1.9@dev
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 mpndev/d8tdd contains the following files

Loading the files please wait ....