Bulk substitution across all PHP files in src/ and test/. Covers namespace declarations, use statements, fully-qualified class references, and @package PHPDoc tags. No logic changes.
41 lines
1.2 KiB
PHP
41 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace IndifferentKetchup\Codex\Test\Tests\Detective;
|
|
|
|
use IndifferentKetchup\Codex\Detective\MultiPatternDetector;
|
|
use IndifferentKetchup\Codex\Log\File\StringLogFile;
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
class MultiPatternDetectorTest extends TestCase
|
|
{
|
|
public function testDetectSinglePattern(): void
|
|
{
|
|
$this->assertTrue((new MultiPatternDetector())
|
|
->setLogFile(new StringLogFile("You can detect this."))
|
|
->addPattern('/detect/')
|
|
->detect()
|
|
);
|
|
}
|
|
|
|
public function testDetectMultiplePatterns(): void
|
|
{
|
|
$this->assertTrue((new MultiPatternDetector())
|
|
->setLogFile(new StringLogFile("You can detect this and this."))
|
|
->addPattern('/detect/')
|
|
->addPattern('/and this/')
|
|
->detect()
|
|
);
|
|
}
|
|
|
|
public function testNotDetectMissingFromMultiplePatterns(): void
|
|
{
|
|
$this->assertFalse((new MultiPatternDetector())
|
|
->setLogFile(new StringLogFile("You can detect this and this."))
|
|
->addPattern('/detect/')
|
|
->addPattern('/and this/')
|
|
->addPattern('/but not this/')
|
|
->detect()
|
|
);
|
|
}
|
|
}
|