for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Tests\CustomerGauge\Password;
use PHPUnit\Framework\TestCase;
use CustomerGauge\Password\Rule;
use CustomerGauge\Password\RuleChain;
class RuleChainTest extends TestCase
{
public function test_it_can_validate_rules()
$rule = $this->createMock(Rule::class);
$rule->expects($this->once())
->method('__invoke');
$validate = new RuleChain($rule);
$validate('password');
}
public function test_it_can_validate_callables()
$function = function() {};
$customMethod = new FixtureCustomMethod;
$validate = new RuleChain(
'is_string',
$function,
[$customMethod, 'customMethod'],
$rule
);
class FixtureCustomMethod
public function customMethod(string $value) : void
$value
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.