示例#1
0
 /**
  * Test the author mapping.
  *
  * @return void
  */
 public function testCopyLeftAuthors()
 {
     $config = new Config();
     $config->addCopyLeft('Copy Left <*****@*****.**>', 'File.php');
     $config->addCopyLeft('Copy Left <*****@*****.**>', array('File2.php', '/lib/**'));
     $config->addCopyLeft('Copy Left2 <*****@*****.**>', 'some/dir/File4.php');
     $this->assertTrue($config->isCopyLeftAuthor('Copy Left <*****@*****.**>', '/some/dir/File.php'));
     $this->assertTrue($config->isCopyLeftAuthor('Copy Left <*****@*****.**>', '/some/dir/File2.php'));
     $this->assertTrue($config->isCopyLeftAuthor('Copy Left <*****@*****.**>', '/lib/dir/File.php'));
     $this->assertFalse($config->isCopyLeftAuthor('Copy Left <*****@*****.**>', '/some/dir/File3.php'));
     $this->assertFalse($config->isCopyLeftAuthor('Unknown <*****@*****.**>', '/some/dir/File3.php'));
     $this->assertTrue($config->isCopyLeftAuthor('Copy Left2 <*****@*****.**>', '/lib/some/dir/File4.php'));
     $this->assertTrue($config->isCopyLeftAuthor('Copy Left2 <*****@*****.**>', '/some/dir/File4.php'));
 }