Download the PHP package tyler36/phpunit-helper-traits without Composer

On this page you can find all versions of the php package tyler36/phpunit-helper-traits. 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 phpunit-helper-traits

``# PHPUnit Traits

Installation

1.Install package through composer.


Intro

These traits were designed and tested with Laravel 5.2, with Laravel-elixir 5. Using laravel-elixir's 'visit' command will test a page is available and generate a crawler object used for some of the tests. Check the tests directory for further examples and uses.

CheckAssetExistsTrait

Check if item/s are available, and also appears on the page. If the string starts with 'http', this trait will make a HTTP request to the web and check if the asset is available. Usefully for checking CDNs. Other paths will begin looking in the projects 'public' directory ("app()->publicPath()"). If the tests has a crawler object, this trait will also check if the string is displayed on the page.

*Returns TEST case to allow chaining.

USE: Include trait within class -

Call trait with filename or array -

EG.

CountElementsTrait

Check page and counts occurrence of specified CSS selector.

USE: Include trait within class -

Call trait with CSS selector and expected count -

EG.

DisableExceptionHandlerTrait

This trait overwrites the default exception handler, allowing you to check error messages with assertions.

USE: Include trait within class -

Call trait with CSS selector to disable exception handling -

Use TRY / CATCH in test.

ImpersonateTrait

Helper for setting authenticated state.

asGuest

Ensure current status is guest (logged out).

USE: Include trait within class -

EG.

asMember

Ensure current status is member (logged out). If a user object is passed, this trait will login as that user. If no user object is passed, this trait will use a 'App\User' factory to create a random User object and log in.

USE: Include trait within class -

EG.

MailTrackingTrait

Inspired by phpunit-testing-in-laravel Check mail options by intercepting sent mails. You may want to prevent laravel from sending mail by using the log driver; in a test or setUp() function

USE: Include trait within class -

seeEmailWasNotSent

ASSERT: Mail was NOT sent

seeEmailWasSent

ASSERT: Mail was sent

seeEmailsSent($count)

ASSERT: $count number of emails were sent

seeEmailTo($recipient)

ASSERT: Recipient

seeEmailNotTo($recipient)

ASSERT: NOT Recipient

seeEmailFrom($sender)

ASSERT: Sender

seeEmailNotFrom($sender)

ASSERT: NOT Sender

seeEmailEquals($body)

ASSERT: Body Matches

seeEmailNotEquals($body)

ASSERT: Body NOT Matches

seeEmailContains($excerpt)

ASSERT: Body contains fragment

seeEmailNotContains($excerpt)

ASSERT: Body NOT contains fragment

seeEmailSubjectEquals($subject)

ASSERT: Subject Matches

seeEmailSubjectNotEquals($subject)

ASSERT: Subject NOT Matches

seeEmailSubjectContains($excerpt)

ASSERT: Subject contains

seeEmailSubjectNotContains($excerpt)

ASSERT: Subject NOT contains

PrepareFileUploadTrait

Simulate a file upload

Include trait within class -

Call trait with filename or array -

EG.


All versions of phpunit-helper-traits with dependencies

PHP Build Version
Package Version
No informations.
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 tyler36/phpunit-helper-traits contains the following files

Loading the files please wait ....