Files
ik-codex/test/tests/Detective/MultiPatternDetectorTest.php
indifferentketchup 66a2fcc5f3 Rename namespace Aternos\Codex to IndifferentKetchup\Codex
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.
2026-04-30 15:13:52 +00:00

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()
);
}
}