Пример #1
0
 /**
  * @param string $text
  * @param int $type
  * @dataProvider providerReferenceTypeDetection
  */
 public function testReferenceTypeDetection(string $text, int $type)
 {
     $referenceList = Parser::factory()->setText($text)->getLocator()->getReferenceList();
     $this->assertCount(1, $referenceList);
     $reference = $referenceList[0];
     $this->assertEquals($type, $reference->getType(), "Incorrect reference type detection");
 }
Пример #2
0
 /**
  * Returns parser object.
  *
  * @return Parser
  */
 protected function getParser() : Parser
 {
     if (null === $this->parser) {
         $this->parser = Parser::factory();
     }
     return $this->parser;
 }