All Projects β†’ ergebnis β†’ test-util

ergebnis / test-util

Licence: MIT license
πŸ‘“ Provides utilities for tests.

Programming Languages

PHP
23972 projects - #3 most used programming language
Makefile
30231 projects
shell
77523 projects

Projects that are alternatives of or similar to test-util

phpunit-json-assertions
JSON assertions for PHPUnit (including JSON Schema)
Stars: ✭ 30 (+100%)
Mutual labels:  phpunit, phpunit-assertions
PhpUnitAssertException
Assert exception/throwable/error PHPUnit trait
Stars: ✭ 18 (+20%)
Mutual labels:  phpunit, phpunit-assertions
phpunit-util
Helper package to ease testing with PHPUnit.
Stars: ✭ 18 (+20%)
Mutual labels:  phpunit, phpunit-util
FakerDotNet
A .NET port of the Ruby faker gem
Stars: ✭ 15 (+0%)
Mutual labels:  faker
apollobank
A full stack GraphQL banking application using React, Node & TypeScript.
Stars: ✭ 203 (+1253.33%)
Mutual labels:  faker
php.autotest
autotest for php written in php
Stars: ✭ 19 (+26.67%)
Mutual labels:  phpunit
miz
🎯 Generate fake data, Just like a person.
Stars: ✭ 24 (+60%)
Mutual labels:  faker
swagger-faker
Generate mocker services automatically through Swagger or OpenAPI.
Stars: ✭ 26 (+73.33%)
Mutual labels:  faker
framework
A PHP framework for rapidly building web applications.
Stars: ✭ 48 (+220%)
Mutual labels:  phpunit
concise
βœ… Concise is test framework for using plain English and minimal code, built on PHPUnit.
Stars: ✭ 47 (+213.33%)
Mutual labels:  phpunit
jedi-faker
Faker extension for Star Wars junkie
Stars: ✭ 15 (+0%)
Mutual labels:  faker
think-phpunit
ThinkPHP5β€”β€”phpunit桋试用例
Stars: ✭ 17 (+13.33%)
Mutual labels:  phpunit
bypass
β†ͺ️ Bypass for PHP creates a custom HTTP Server to return predefined responses to client requests. Useful for tests with Pest PHP or PHPUnit.
Stars: ✭ 98 (+553.33%)
Mutual labels:  faker
generator-composer
🐘 Yeoman (http://yeoman.io) generator for a PHP Composer project
Stars: ✭ 16 (+6.67%)
Mutual labels:  phpunit
faker-schema
Generate fake data using joke2k's faker and your own schema
Stars: ✭ 91 (+506.67%)
Mutual labels:  faker
covers-validator
Validates covers tags in PHPUnit tests
Stars: ✭ 21 (+40%)
Mutual labels:  phpunit
phpunit-mink
Library for using Mink in PHPUnit tests. Supports session sharing between tests in a test case.
Stars: ✭ 71 (+373.33%)
Mutual labels:  phpunit
laravel-survey
Laravel 6 survey app.
Stars: ✭ 39 (+160%)
Mutual labels:  phpunit
phpunit-documentation-russian
Russian Documentation for PHPUnit
Stars: ✭ 16 (+6.67%)
Mutual labels:  phpunit
phpunit-randomizer
A PHPUnit extension that allows you to execute your test cases in a random order
Stars: ✭ 52 (+246.67%)
Mutual labels:  phpunit

test-util

Integrate Prune Release Renew

Code Coverage Type Coverage

Latest Stable Version Total Downloads

Provides a helper trait for tests.

Installation

Run

$ composer require --dev ergebnis/test-util

Usage

Helper

Import the Ergebnis\Test\Util\Helper trait into your test class:

<?php

declare(strict_types=1);

namespace Foo\Bar\Test\Unit;

use Ergebnis\Test\Util;
use PHPUnit\Framework;

final class BazTest extends Framework\TestCase
{
    use Util\Helper;
}

Easy access to localized instances of Faker\Generator

The Helper trait provides a method to fetch a localized instance of Faker\Generator:

  • faker(string $locale = 'en_US') : \Faker\Generator
<?php

declare(strict_types=1);

namespace Example\Test\Unit;

use Ergebnis\Test\Util;
use Example\Player;
use PHPUnit\Framework;

final class PlayerTest extends Framework\TestCase
{
    use Util\Helper;

    public function testConstructorSetsValues(): void
    {
        $name = self::faker()->firstName;

        $player = new Player($name);

        $this->assertSame($name, $player->firstName());
    }
}

For reference, see fzaninotto/faker.

Changelog

Please have a look at CHANGELOG.md.

Contributing

Please have a look at CONTRIBUTING.md.

Code of Conduct

Please have a look at CODE_OF_CONDUCT.md.

License

This package is licensed using the MIT License.

Please have a look at LICENSE.md.

Curious what I am building?

πŸ“¬ Subscribe to my list, and I will occasionally send you an email to let you know what I am working on.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].