2017 © Pedro PelĂĄez
 

library test-helper

Provides a test helper for use with tests.

image

localheinz/test-helper

Provides a test helper for use with tests.

  • Tuesday, August 29, 2017
  • by localheinz
  • Repository
  • 1 Watchers
  • 1 Stars
  • 0 Installations
  • Shell
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

test-util

Integrate Prune Release Renew, (*1)

Code Coverage Type Coverage, (*2)

Latest Stable Version Total Downloads, (*3)

Provides a helper trait for tests., (*4)

Installation

Run, (*5)

$ composer require --dev ergebnis/test-util

Usage

Helper

Import the Ergebnis\Test\Util\Helper trait into your test class:, (*6)

<?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:, (*7)

  • 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., (*8)

Changelog

Please have a look at CHANGELOG.md., (*9)

Contributing

Please have a look at CONTRIBUTING.md., (*10)

Code of Conduct

Please have a look at CODE_OF_CONDUCT.md., (*11)

License

This package is licensed using the MIT License., (*12)

Please have a look at LICENSE.md., (*13)

Curious what I am building?

:mailbox_with_mail: Subscribe to my list, and I will occasionally send you an email to let you know what I am working on., (*14)

The Versions

29/08 2017

dev-master

9999999-dev

Provides a test helper for use with tests.

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

by Andreas Möller