Ejemplo n.º 1
0
 /**
  * @covers ::extractAll
  */
 public function testExtractAll()
 {
     $this->object->setText('Hello world!');
     $this->assertSame($this->object->extractAll(), $this->object);
     $this->assertEquals($this->object->hashtags, array());
     $this->assertEquals($this->object->emails, array());
     $this->assertEquals($this->object->urls, array());
     $this->assertEquals($this->object->usernames, array());
 }
Ejemplo n.º 2
0
 /**
  * Extract URLs, emails, usernames and hashtags from text
  * 
  * @param string $text Source text
  * @return Extractor
  * @deprecated 1.1
  */
 public static function extract($text = '')
 {
     $extractor = new Extractor($text);
     return $extractor->extractAll();
 }