dev-master
9999999-devProvides a test helper for use with tests.
MIT
The Requires
- php ^7.0
The Development Requires
by Andreas Möller
Wallogit.com
2017 © Pedro PelĂĄez
Provides a test helper for use with tests.
Provides a helper trait for tests., (*4)
Run, (*5)
$ composer require --dev ergebnis/test-util
HelperImport 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;
}
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)
Please have a look at CHANGELOG.md., (*9)
Please have a look at CONTRIBUTING.md., (*10)
Please have a look at CODE_OF_CONDUCT.md., (*11)
This package is licensed using the MIT License., (*12)
Please have a look at LICENSE.md., (*13)
: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)
Provides a test helper for use with tests.
MIT