Download the PHP package tatter/imposter without Composer

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

Tatter\Imposter

Mock authentication for CodeIgniter 4

Coverage Status

Quick Start

  1. Install with Composer: > composer require --dev tatter/imposter
  2. Access via the service: $user = service('auth')->user();

Description

Imposter provides a thin authentication layer for testing your CodeIgniter apps that require authentication. This library is for testing purposes only. The tiny footprint and easy-to-use interfaces make it ideal for handling mock authentication in a rapid way.

Imposter fulfills all the CodeIgniter authentication guidelines and thus supplies the Composer provision for codeigniter4/authentication-implementation.

Installation

Install easily via Composer to take advantage of CodeIgniter 4's autoloading capabilities and always be up-to-date:

Or, install manually by downloading the source files and adding the directory to app/Config/Autoload.php.

Usage

Use the service to log a user in or out.

The current status can be checked by getting the ID or User; both will be null if no user is authenticated.

You may also load the helper to use the user_id() convenience method as outlined in the CodeIgniter authentication guidelines.

Users

Imposter comes with a minimal set of classes to be fully compatible with Tatter\Users. This means that any project or library which uses the interfaces from Tatter\Users can be tested using Imposter without the need of an actual authentication library or even a database.

User Entity

The Tatter\Imposter\Entities\User entity class implements all three entity interfaces from Tatter\Users: UserEntity, HasGroup, and HasPermission. Use it like any regular entity, except that the $groups and $permissions atributes are simple CSV casts for storing your entity relationships:

Imposter Factory

The ImposterFactory class allows UserProvider to use the Imposter classes automatically during testing. To enable ImposterFactory add it to the list of providers during your test's setUp or setUpBeforeClass phase:

Because Imposter is a database-free solution UserFactory has its own local storage for User entities. Use the static methods to manipulate the storage to stage your tests:

For example:


All versions of imposter with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4 || ^8.0
tatter/users Version ^1.2
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 tatter/imposter contains the following files

Loading the files please wait ....