for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file is part of CaptainHook
*
* (c) Sebastian Feldmann <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace CaptainHook\App\Hook\Message\Rule;
use SebastianFeldmann\Git\CommitMessage;
use PHPUnit\Framework\TestCase;
class BlacklistTest extends TestCase
{
public function testCaseInsensitiveHit(): void
$msg = new CommitMessage('Foo bar baz' . PHP_EOL . PHP_EOL . 'Some Body text that is longer');
$list = new Blacklist(false);
$list->setBodyBlacklist(['body']);
$list->setSubjectBlacklist(['Fiz']);
$this->assertFalse($list->pass($msg));
}
public function testCaseSensitiveMiss(): void
$list = new Blacklist(true);
$this->assertTrue($list->pass($msg));