[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/src/applications/diffusion/query/__tests__/ -> DiffusionGitFileContentQueryTestCase.php (source)

   1  <?php
   2  
   3  final class DiffusionGitFileContentQueryTestCase extends PhabricatorTestCase {
   4  
   5    public function testAuthorName() {
   6      // A normal case - no parenthesis in user name
   7      $result = DiffusionGitFileContentQuery::match(
   8        '8220d5d54f6d5d5552a636576cbe9c35f15b65b2 '.
   9        '(Andrew Gallagher       2010-12-03      324) $somevar = $this->call()');
  10      $this->assertEqual($result[0], '8220d5d54f6d5d5552a636576cbe9c35f15b65b2');
  11      $this->assertEqual($result[1], 'Andrew Gallagher');
  12      $this->assertEqual($result[2], ' $somevar = $this->call()');
  13  
  14      // User name like 'Jimmy (He) Zhang'
  15      $result = DiffusionGitFileContentQuery::match(
  16        '8220d5d54f6d5d5552a636576cbe9c35f15b65b2 '.
  17        '( Jimmy (He) Zhang    2013-10-11    5) '.
  18        'code(); "(string literal 9999-99-99 2)"; more_code();');
  19      $this->assertEqual($result[1], 'Jimmy (He) Zhang');
  20      $this->assertEqual($result[2],
  21        ' code(); "(string literal 9999-99-99 2)"; more_code();');
  22  
  23      // User name like 'Scott Shapiro (Ads Product Marketing)'
  24      $result = DiffusionGitFileContentQuery::match(
  25        '8220d5d54f6d5d5552a636576cbe9c35f15b65b2 '.
  26        '( Scott Shapiro (Ads Product Marketing)    2013-10-11    5) '.
  27        'code(); "(string literal 9999-99-99 2)"; more_code();');
  28      $this->assertEqual($result[1], 'Scott Shapiro (Ads Product Marketing)');
  29      $this->assertEqual($result[2],
  30        ' code(); "(string literal 9999-99-99 2)"; more_code();');
  31    }
  32  }


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