narrowspark / testing-helper
Provides test helpers.
Fund package maintenance!
prisis
Installs: 60 872
Dependents: 39
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 2
Open Issues: 5
Requires
- php: ^7.2
- phpunit/phpunit: ^8.0
- psr/container: ^1.0.0
- psr/http-factory: ^1.0.0
- psr/http-message: ^1.0.0
- psr/http-server-middleware: ^1.0.0
Requires (Dev)
- ext-json: *
- fzaninotto/faker: ^1.8.0
- guzzlehttp/psr7: ^1.6.1
- mockery/mockery: ^1.2.3
- narrowspark/coding-standard: ^3.1.0
- slam/phpstan-extensions: ^3.6
Suggests
- fzaninotto/faker: Required to use the FakerTrait (^1.6)
- mockery/mockery: Required to use the MockeryTestCase (^0.9)
- nyholm/nsa: Required to test your private/protected methods/properties (^1.1).
- dev-master
- 8.0.2
- 8.0.1
- 8.0.0
- v7.0.0
- v6.0.0
- v5.0.0
- v4.0.1
- v4.0.0
- v3.0.0
- v2.1.0
- v2.0.0
- v1.6.0
- v1.5.0
- v1.4.0
- v1.3.0
- v1.2.0
- v1.1.0
- v1.0.0
- dev-renovate/configure
- dev-dependabot/add-v2-config-file
- dev-dependabot/composer/psr/container-tw-1.0.0or-tw-2.0.0
- dev-dependabot/composer/slam/phpstan-extensions-tw-3.6or-tw-4.0
This package is auto-updated.
Last update: 2023-03-26 11:08:03 UTC
README
Installation
Via Composer
$ composer require narrowspark/testing-helper
Usage
use Narrowspark\TestingHelper\Traits\AssertArrayTrait; class ModelTest extends \PHPUnit_Framework_TestCase { use AssertArrayTrait; // Now you can do something like this. public function testIfArrayContainIrix() { $haystack = ['Mac', 'NT', 'Irix', 'Linux']; self::assertInArray('Irix', $haystack); } // or public function testAssertArraySubsetThrowsExceptionForInvalidSubset(): void { $this->expectException(ExpectationFailedException::class); $this->assertArraySubset([6, 7], [1, 2, 3, 4, 5, 6]); } }
Testing
You need to run:
$ phpunit
Contributing
If you would like to help take a look at the list of issues and check our Contributing guild.
Note: Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
Credits
License
The MIT License (MIT). Please see License File for more information.