rnr1721/le7-testing

Testing tools for le7 PHP framework

1.0.3 2023-05-20 16:42 UTC

This package is auto-updated.

Last update: 2024-12-20 20:44:36 UTC


README

L77 PHP MVC framework testing tools

Requirements

  • PHP 8.1 or higher.
  • Composer 2.0 or higher.

What it can?

it can create mock objects for testing le7 framework.

  • ServerRequestInterface
  • ResponseInterface
  • LoggerInterface
  • CacheInterface
  • Session
  • Cookies

Installation

composer require rnr1721/le7-testing

Testing

composer test

How it works?

use Core\Testing\MegaFactory;

    $megaFactory = new MegaFactory();

    // Get file logger
    $logger = $megaFactory->getLogger(false,'file.log');
    
    // Get ServerRequestInterface
    $request = $megaFactory->getServer()->getServerRequest('http://example.com', 'GET');

    // etc...