Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Phpunit Test Case Laravel Package

herrera-io/phpunit-test-case

PHPUnit TestCase class and Extras trait that add helpers for common test chores: create/delete temporary files and directories, call protected/private methods, and get/set protected/private properties. Use as a base class or mix into your own test case.

View on GitHub
Deep Wiki
Context7

PHPUnit TestCase

Build Status

A PHPUnit test case class and trait with additional functionality.

Summary

The TestCase class and Extras trait provide additional methods for performing basic, repetitive tasks such as:

  • creating and deleting temporary files and directories
  • calling protected and private methods
  • retrieving and setting protected and private properties

NOTE Both TestCase and Extras are identical, except the former being a class and the latter being a trait.

Installation

Add it to your list of Composer dependencies:

$ composer require herrera-io/phpunit-test-case=1.*

Usage

The TestCase class

<?php

class MyTestCase extends Herrera\PHPUnit\TestCase
{
    // my tests
}

The Extras trait

<?php

class MyTestCase extends My\Own\Custom\TestCase
{
    use Herrera\PHPUnit\Extras;

    // my tests
}

NOTE If your test class provides its own tearDown() method, make sure to call the class's or trait's tearDown() method as well. TestCase and Extras uses the tear down process to clean up temporary files and directories.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
codeflextech/permission-manager
karnoweb/livewire-datepicker
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver