[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/src/applications/project/remarkup/__tests__/ -> ProjectRemarkupRuleTestCase.php (source)

   1  <?php
   2  
   3  final class ProjectRemarkupRuleTestCase extends PhabricatorTestCase {
   4  
   5    public function testProjectObjectRemarkup() {
   6      $cases = array(
   7        'I like #ducks.' => array(
   8          'embed' => array(),
   9          'ref' => array(
  10            array(
  11              'offset' => 8,
  12              'id' => 'ducks',
  13            ),
  14          ),
  15        ),
  16        'We should make a post on #blog.example.com tomorrow.' => array(
  17          'embed' => array(),
  18          'ref' => array(
  19            array(
  20              'offset' => 26,
  21              'id' => 'blog.example.com',
  22            ),
  23          ),
  24        ),
  25        'We should make a post on #blog.example.com.' => array(
  26          'embed' => array(),
  27          'ref' => array(
  28            array(
  29              'offset' => 26,
  30              'id' => 'blog.example.com',
  31            ),
  32          ),
  33        ),
  34        '#123' => array(
  35          'embed' => array(),
  36          'ref' => array(),
  37        ),
  38        '#security#123' => array(
  39          'embed' => array(),
  40          'ref' => array(
  41            array(
  42              'offset' => 1,
  43              'id' => 'security',
  44              'tail' => '123',
  45            ),
  46          ),
  47        ),
  48      );
  49  
  50      foreach ($cases as $input => $expect) {
  51        $rule = new ProjectRemarkupRule();
  52        $matches = $rule->extractReferences($input);
  53        $this->assertEqual($expect, $matches, $input);
  54      }
  55    }
  56  
  57  }


Generated: Sun Nov 30 09:20:46 2014 Cross-referenced by PHPXref 0.7.1