1. Go to this page and download the library: Download narrowspark/testing-helper library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
narrowspark / testing-helper example snippets
php
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]);
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.