Initial import from aternosorg/codex-minecraft
This commit is contained in:
25
test/tests/Detective/SinglePatternDetectorTest.php
Normal file
25
test/tests/Detective/SinglePatternDetectorTest.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Codex\Test\Tests\Detective;
|
||||
|
||||
use Aternos\Codex\Detective\SinglePatternDetector;
|
||||
use Aternos\Codex\Log\File\StringLogFile;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class SinglePatternDetectorTest extends TestCase
|
||||
{
|
||||
public function testDetect(): void
|
||||
{
|
||||
$this->assertTrue((new SinglePatternDetector())
|
||||
->setLogFile(new StringLogFile("You can detect this."))
|
||||
->setPattern('/detect/')
|
||||
->detect()
|
||||
);
|
||||
|
||||
$this->assertFalse((new SinglePatternDetector())
|
||||
->setLogFile(new StringLogFile("You cannot detect this."))
|
||||
->setPattern('/missing/')
|
||||
->detect()
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user