You are here

public function ReaderTest::testFindPattern in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/css-selector/Tests/Parser/ReaderTest.php \Symfony\Component\CssSelector\Tests\Parser\ReaderTest::testFindPattern()

File

vendor/symfony/css-selector/Tests/Parser/ReaderTest.php, line 67

Class

ReaderTest

Namespace

Symfony\Component\CssSelector\Tests\Parser

Code

public function testFindPattern() {
  $reader = new Reader('hello');
  $this
    ->assertFalse($reader
    ->findPattern('/world/'));
  $this
    ->assertEquals(array(
    'hello',
    'h',
  ), $reader
    ->findPattern('/^([a-z]).*/'));
  $this
    ->assignPosition($reader, 2);
  $this
    ->assertFalse($reader
    ->findPattern('/^h.*/'));
  $this
    ->assertEquals(array(
    'llo',
  ), $reader
    ->findPattern('/^llo$/'));
}